Skip to content

Instantly share code, notes, and snippets.

@heliac2000
heliac2000 / reformat_syukujitsu_csv.sh
Created February 23, 2017 02:35
Reformat `syukujitsu.csv' by jq command
curl -s http://www8.cao.go.jp/chosei/shukujitsu/syukujitsu.csv |
nkf -w -Lu |
sed -n '/^元/,/^天/p' |
jq -s -R -r '
./"\n" | map(./",") | (
map([(.[0]),(.[1])]), map([(.[2]),(.[3])]), map([(.[4]),(.[5])])
) | map(join("\t"))[]
'