Last active
April 5, 2016 03:31
-
-
Save hantuzun/4aa1293107d1b876959b9606e07b8657 to your computer and use it in GitHub Desktop.
Creates item metadata json file form links.csv of http://files.grouplens.org/datasets/movielens/ml-latest.zip
This file contains 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 characters
#!/bin/awk -f | |
BEGIN { printf "{\"items\": [\n" } | |
{ | |
FS=","; | |
if(NR>2) printf ", \n" | |
if(NR>1) printf " { \"id\": \"%s\", \"imdb_id\": \"tt%s\"}", $1, $2 | |
} | |
END { printf "\n]}\n" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awk -f links_to_metadata.awk links.csv > movies_metadata.json