Quantcast
Channel: Search for lines that do not have certain characters in a row - Unix & Linux Stack Exchange
Browsing all 2 articles
Browse latest View live

Answer by BarBar1234 for Search for lines that do not have certain characters...

If your file name is called Myfile.txt you can run: grep -Ev '[Tt][Tt]|[Hh][Hh]' Myfile.txt | awk '{ gsub("([^[:alnum:]]|^)[[:alnum:]]{4}([[:space:]]|[[:punct:]])"," D ");print $0}' > MyEditedFile.txt

View Article



Search for lines that do not have certain characters in a row

I have a news article which I need to edit up a bit. Basically, I need to search for all lines that do not contain characters t and h 2 or more times in a row and replace 4 letter words with character...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images