using grep (question)
Hello
using grep I wish to know if in a test.txt file if there are lines containing more than 4 "." (more than 4 dots). Any way to do this ? Thank you |
I'd prefer awk to parse a file line-by-line, but if you really want to use grep, you can try something like:
Code:
while read line |
Quote:
grep -o [.] , does not seem to work , it only return a single "." for each line. |
More than 4 consecutive dots regex can handle - more than 4 spread in an unknown pattern, that would require a deal of programming logic.
Sounds like a task for perl. |
Quote:
Code:
$ cat file |
I read the question differently - in my defence I blame poorly defined specifications.
... :eek: |
All times are GMT -5. The time now is 07:29 AM. |