Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
a small converter for a dataset from
f ="u.item_utf8")
ls = f.readlines
puts "["
ls.each do |l|
fs = l.split("|")
/(.*) \((\d+)\)$/.match(fs[1])
title = $1
year = $2
url = fs[4]
puts %Q{{"title": "#{title}", "year": #{year ? year : 0}, "url": "#{url}"}, }
puts "]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment