I have a file with million records and each line ends with SYSTEM;\N
.
I want to delete all occurrences of ;\N
from file. How can I approach this?
You can use the sed command to replace all the occurrences of the ';\N' from the file and replace it with ''.
sed -i 's/original/new/g' file.txt
Explanation:
sed = Stream EDitor
-i = in-place (i.e. save back to the original file)
The command string: s = the substitute command
original = a regular expression describing the word to replace (or just the word itself)
new = the text to replace it with
g = global (i.e. replace all and not just the first occurrence)
file.txt = the file name
This worked finally sed -i '' 's/;\\N//g' test112.csv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With