Skip to content

Instantly share code, notes, and snippets.

@csu
Created August 31, 2012 16:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csu/3555296 to your computer and use it in GitHub Desktop.
Save csu/3555296 to your computer and use it in GitHub Desktop.
Import all txt files in a directory into Day One
# Part of the txt-to-dayone repository: https://github.com/christophersu/txt-to-dayone
IFS=$'\n'
files=$(ls | egrep '(.txt)')
for i in $files; do
created=$( GetFileInfo -d "$i" )
dayone -d="$created" new < "$i"
done
unset IFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment