I consider myself a regex noob, but I created a bunch of files with variable length strings in them and I think I got what you wanted, try this:
user@host$ grep -e '[^\ ]\{7,\}' *
For those who don't quite understand this:
-e makes grep search using a regex. [^\ ] means to match a single character except space. \{7,\} means to match a string of 7 or more characters. If you were to put another number afther , it would be strings between 7 and x characters.
I couldn't get the example above to work. I was searching for lines in a CSV file longer than 10000 characters. I messed around quite a bit and got this...
Find lines longer than 9999 characters...
grep -a -e '[^\ ]\{9999,\}' *.csv >../my-file.csv
And this is what I really needed. Lines in CSV file less than 10000 characters.
find lines less than 9999 characters
grep -a -v -e '[^\ ]\{9999,\}' *.csv >../my-file.csv
I consider myself a regex noob, but I created a bunch of files with variable length strings in them and I think I got what you wanted, try this:
user@host$ grep -e '[^\ ]\{7,\}' *
For those who don't quite understand this:
-e
makes grep search using a regex.[^\ ]
means to match a single character except space.\{7,\}
means to match a string of 7 or more characters. If you were to put another number afther , it would be strings between 7 and x characters.I couldn't get the example above to work. I was searching for lines in a CSV file longer than 10000 characters. I messed around quite a bit and got this... Find lines longer than 9999 characters...
And this is what I really needed. Lines in CSV file less than 10000 characters. find lines less than 9999 characters