I would like to zero one column of a csv file. Let's assume the csv file looks like this:
col1|col2|col3
v | 54| t
a | 25| f
d | 53| f
s | 04| t
Using awk this way, gives me almost what I want
command:
awk -F'|' -v OFS='|' '$2=0.0;7' input.csv > output.csv
the result
col1|0|col3
v |0| t
a |0| f
d |0| f
s |0| t
But notice that the column header has been also zeroed which is something I am trying to avoid. So I tried to skip the first line with the awk command but I am getting an empty file
awk -F'|' -v OFS='|' 'NR<1 {exit} {$5=0.0;7}' input.csv > output.csv
What am I missing?