Skip to content
Advertisement

Tag: replace

How can I fix the following sed command?

I am trying to append _out to anything that matches the regex shown in the follwing sed command. The _out should be before the [ (]. The command returns the lines correctly as I expect. Now the problem comes when I try the following command where I define regions to use in the replacement. So for example if I have

Replacing String Columnwise Using Sed

Given this data I want to replace the string at 2nd column into “” if it is “qux”. Resulting: How do you do that with sed? In particular the data is very big with ~10^7 lines Answer I wouldn’t actually do it with sed since that’s not the best tool for the job. The awk tool is my tool of

Advertisement