awk command sample for mapping some column values in some .csv file $ cat origin.csv id,created,notes 1,1518393600000,blahblah 2,1518393600000,foobar # Case1: We want to all column2 values (e.g. unix timestamp-ish value) to formatted datetime $ head -1 origin.csv > /dev/stdout && tail origin.csv -n+2 | awk -F "," '{gsub($2, strftime("%Y-%m-%d %H:%M:%S", substr($2, 0, 10))); print}' >> /dev/stdout id,created,notes 1,2018-02-12 00:00:00,blahblah 2,2018-02-12 00:00:00,foobar Notes # cat only header row $ head -1 origin.csv > /dev/stdout id,created,notes # cat only body rows $ tail origin.csv -n+2 1,1518393600000,blahblah 2,1518393600000,foobar # replace column2 unix timestamp value to formatted datetime value $ echo "1,1518393600" | awk -F "," '{gsub($2, strftime("%Y-%m-%d %H:%M:%S", $2)); print}' 1,2018-02-12 00:00:00