Replace semicolon within double quotes in a file with semicolon delimiter

Hello Team,

Could you please help me with the below question?
I have a file with the following properties

1) File Delimiter is ;
2) Text columns are within double quotes
3) Numeric columns will not have double quotes
4) File has total 6 columns

Please see a sample record from file

"TRP";037;5;"EDA";"Paper and Paperboard";"""for production; not including office supplies.  Pulp molded"

Here the last column has a semicolon in between. As a result my script is not reading the file correctly.
Do we have a way to replace the semicolon with space?

Regards
Sam

Please use code tags as required by forum rules!

This problem has been solved several times before. Are you sure you searched theses fora? However, try

awk -F\" '{for (i=2; i<=NF; i+=2) gsub (/;/, " ", $i)} 1' OFS=\" file
"TRP";037;5;"EDA";"Paper and Paperboard";"""for production  not including office supplies. Pulp molded"
1 Like

awk split

awk '{split($0,t,";");print t[1] ";" t[2] ";" t[3] ";" t[4] ";" t[5] ";" t[6] t[7]}' file

Thank you Looney.

Guess I missed to mention point. The number of columns can change each time for a file. It can 6 today and 8 tomorrow...Sorry about that