Skip to main content
edited tags
Link
code format
Source Link
Sparhawk
  • 20.6k
  • 20
  • 97
  • 160

I am trying to grep column 7th with pipe delimiter (||) data in that I have to removed pipe  (||) from middle of text.

Sample file: col1|col2|col3|col4|col5|col6|col7|col8|col9|col10 value1|value2|value3|value4|value5|value6|"value7|text"|value8|value9|value10

col1|col2|col3|col4|col5|col6|col7|col8|col9|col10
value1|value2|value3|value4|value5|value6|"value7|text"|value8|value9|value10

Problem in column no.7 : In that I have to removed "|"| from middle of text. "value7|text"value7|text

Required output for column 7 is: "value7 text"value7 text

Now I am trying to write awk command which goes to column 7,relacereplace (||) pipe with blank so I can treat it as single string to make my process work.

Final output should be like this: col1|col2|col3|col4|col5|col6|col7|col8|col9|col10 value1|value2|value3|value4|value5|value6|"value7 text"|value8|value9|value10

col1|col2|col3|col4|col5|col6|col7|col8|col9|col10
value1|value2|value3|value4|value5|value6|"value7 text"|value8|value9|value10

please suggest.

Thanks,

I am trying to grep column 7th with pipe delimiter (|) data in that I have to removed pipe(|) from middle of text.

Sample file: col1|col2|col3|col4|col5|col6|col7|col8|col9|col10 value1|value2|value3|value4|value5|value6|"value7|text"|value8|value9|value10

Problem in column no.7 : In that I have to removed "|" from middle of text. "value7|text"

Required output for column 7 is: "value7 text"

Now I am trying to write awk command which goes to column 7,relace (|) pipe with blank so I can treat it as single string to make my process work.

Final output should be like this: col1|col2|col3|col4|col5|col6|col7|col8|col9|col10 value1|value2|value3|value4|value5|value6|"value7 text"|value8|value9|value10

please suggest.

Thanks,

I am trying to grep column 7th with pipe delimiter (|) data in that I have to removed pipe  (|) from middle of text.

Sample file:

col1|col2|col3|col4|col5|col6|col7|col8|col9|col10
value1|value2|value3|value4|value5|value6|"value7|text"|value8|value9|value10

Problem in column no.7 : In that I have to removed | from middle of text. value7|text

Required output for column 7 is: value7 text

Now I am trying to write awk command which goes to column 7,replace (|) pipe with blank so I can treat it as single string to make my process work.

Final output should be like this:

col1|col2|col3|col4|col5|col6|col7|col8|col9|col10
value1|value2|value3|value4|value5|value6|"value7 text"|value8|value9|value10

please suggest.

Thanks,

Source Link

Find and replace Pipe using awk command

I am trying to grep column 7th with pipe delimiter (|) data in that I have to removed pipe(|) from middle of text.

Sample file: col1|col2|col3|col4|col5|col6|col7|col8|col9|col10 value1|value2|value3|value4|value5|value6|"value7|text"|value8|value9|value10

Problem in column no.7 : In that I have to removed "|" from middle of text. "value7|text"

Required output for column 7 is: "value7 text"

Now I am trying to write awk command which goes to column 7,relace (|) pipe with blank so I can treat it as single string to make my process work.

Final output should be like this: col1|col2|col3|col4|col5|col6|col7|col8|col9|col10 value1|value2|value3|value4|value5|value6|"value7 text"|value8|value9|value10

please suggest.

Thanks,