echo 'name,creditcard' > `date '+%Y%m%d'`.csv grep 'name"' data.json | \ grep -v 'creditcard":null' | \ tr '{:}' ',' | \ cut -d',' -f3,20 | \ sed 's/"//g' \ >> `date '+%Y%m%d'`.csv