Skip to content

Instantly share code, notes, and snippets.

@darkfeline
Created October 11, 2013 17:24
Show Gist options
  • Save darkfeline/6938649 to your computer and use it in GitHub Desktop.
Save darkfeline/6938649 to your computer and use it in GitHub Desktop.
Convert vimwiki diary format to Emacs Org-Journal format
import datetime
import os
time = datetime.time(tzinfo=datetime.timezone(datetime.timedelta(0)))
time = time.strftime("%H:%M:%S %z")
for entry in os.listdir():
if not entry.endswith(".py"):
date = datetime.date(int(entry[:4]), int(entry[4:6]), int(entry[6:]))
date = date.strftime("%Y-%m-%d %a")
with open(entry) as f:
text = f.read()
with open(entry, 'w') as f:
f.write("* {}\n\n** {}\n{}".format(date, time, text))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment