Given this data
34 foo 34 bar 34 qux 62 foo1 62 qux 78 qux
I want to replace the string at 2nd column into ” if it is ‘qux’. Resulting:
34 foo 34 bar 34 62 foo1 62 78
How do you do that with sed? In particular the data is very big with ~10^7 lines
I wouldn’t actually do it with
sedsince that’s not the best tool for the job. Theawktool is my tool of choice whenever somebody mentions columns.or the simplest form:
If you must use
sed:making sure that you use the correct white space (the above uses only spaces).