Skip to content

Instantly share code, notes, and snippets.

@rlamacraft
Last active January 2, 2021 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlamacraft/584895cb2d7fff60395fa83d9b66e468 to your computer and use it in GitHub Desktop.
Save rlamacraft/584895cb2d7fff60395fa83d9b66e468 to your computer and use it in GitHub Desktop.
Migrating GoodReads CSV export to Recfile
awk -v FPAT='[^,]*|"[^"]+"' 'BEGIN{
print "# -*- mode: rec -*-";
print "";
print "%rec: To Read";
print "";
}
/to-read/ {
gsub("\"","",$2);
print "Name: " $2;
print "Author: " $3;
print "Date: " $16;
gsub("\"","",$17);
print "Tags: " substr($17,10);
print "";
}' $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment