Created
January 18, 2010 17:25
Revisions
-
rgreenjr revised this gist
Jan 19, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -w # # Trims Goodreads CSV files so they import into Delicious Library essential data only. # require 'rubygems' -
rgreenjr revised this gist
Jan 18, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ #!/usr/bin/env ruby -w # # Trims Goodreads CSV files so they import into Delicious Library the essential data only. # -
rgreenjr revised this gist
Jan 18, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/usr/bin/ruby -w # # Trims Goodreads CSV files so they import into Delicious Library the essential data only. # require 'rubygems' -
rgreenjr created this gist
Jan 18, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #!/usr/bin/ruby -w # # Trims Goodreads CSV files so they import into Delicious Library only essential data # require 'rubygems' require 'faster_csv' path = ARGV.empty? ? "/Users/rgreen/Downloads/goodreads_export.csv" : ARGV[0] puts "Title,Author,ASIN,ISBN" text = "" File.open(path) { |file| text = file.read } text.gsub!(/",="/, "\",\"") FasterCSV.parse(text, :headers => true) do |row| puts "\"#{row[0]}\",\"#{row[1]}\",\"#{row[4]}\",\"#{row[4]}\"" end