Reputation: 3081
I have a file with a few tens of thousands of csv lines with some lines that are like "Done nnn" where nnn is a variable number. I want to replace these lines with a blank line. I can rip them out completely if I do a grep -v "Done" filename.txt but I want to replace the "Done" lines with a new line. How can I do this with sed or some other unix cmd line?
Upvotes: 2
Views: 1030
Reputation: 505
Use sed: sed 's/[0-9]*/\n/' filename.txt >newfile.txt
Use whatever your regexp was after s/ and add a g after final / if you are expecting more than one integer per line.
Upvotes: 0