I want to change the value of specific cell in CSV using the bash command line.
I have a sellers.csv:
seller_id,seller_zip_code_prefix,seller_city,seller_state
3442f8959a84dea7ee197c632cb2df15,13023,campinas,SP
723a46b89fd5c3ed78ccdf039e33ac63,93310,novo hamburgo, rio grande do sul, brasil,RS
As you can see, row 3 column 3 (seller_city) is violating the rule because it contains commas. That's why MySQL is saying "Row 3 contained more data than there were input columns".
I want to change novo hamburgo, rio grande do sul, brasil
into novo hamburgo rio grande do sul brasil
.
I tried awk
but its saying I am supplying wrong arguments.
awk -v r=553 -v c=3 -v val="novo hamburgo - rio grande do sul - brasil" -F sellers.csv
awk: option requires an argument -- F