I have 4 columns , separated by a ;
.
Some lines in the 3rd or the 4th column, are huge with more than 10000 characters.
How would you remove the lines , regardless of which columns , where the length of one specific column goes beyond 10000 characters?
I tried with that
awk '{i += (length() + 1); if (i <= 10000) print $ALL}'
But it is taking the whole file and not only specific column and I want the length of the column, regardless if it is the 3rd or the 4th or maybe both.
TIA
All you need is:
$ cat file
a;b;c
d;efg;h
i;j;klm
opqr;s;t
uv;wx;yz
$ egrep -v '[^;]{3}' file
a;b;c
uv;wx;yz
$ awk '!/[^;]{3}/' file
a;b;c
uv;wx;yz
$ sed -r '/[^;]{3}/d' file
a;b;c
uv;wx;yz
Change the "3" to 1001 or whatever...
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