I am trying to grep column 4 with pipe delimiter (|) and replace all double quotes within it and then enclose that string with double quotes again.
sample File:
col1|col2|col3|col4|col5col1|col2|col3|col4|col5|col6|col7|col8|col9
test|test_f|21/03/2017|"|||||USER "RIGHTa anything here|123value1|value2|value3|"|||||value"4|value5|value6|"||value"7|value8|value9
Problem is column 4 is where user can write anything, even a pipe, which is my delimiter and it breaks my process.
E.g. column 4 may be
"|||||USER "RIGHTa anything here"|||||value"4
Now I am trying to write command which goes to column 4, replace all double quotes then enclose it with double quote again so I can treat it as single string to make my process work.
Required Output for column 4 is
"|||||USER RIGHTa anything here""|||||value4"
Similarly I have do the same for column 7, required Output for column 7 is
"||value7"
Final output should look like this:
col1|col2|col3|col4|col5col1|col2|col3|col4|col5|col6|col7|col8|col9
test|test_f|21/03/2017|"|||||USER RIGHTa anything here"|123value1|value2|value3|"|||||value4"|value5|value6|"||value7"|value8|value9
please suggest.
 
                 
                 
                