Cleaning up files with awk
Published at
This TIL is more than a year old. Some details may have changed.
Needed to clean up a JSON file, after I copied the JSON from the browser and got the line numbers too.
Move every even line to clean file
$ awk 'NR % 2 == 0' dirty.json > clean.jsonMove every odd line to clean file
$ awk 'NR % 2 != 0' dirty.json > clean.json