Reputation: 775
Using grep display the lines that have an odd number of characters . Any ideas, I don't know how to get the number of characters from each line, I tried with wc but it only counts the number of characters globally.
Upvotes: 2
Views: 3857
Reputation: 85873
Get the lines with odd number of characters only using grep
:
egrep -v '^(..)+$' file
The normal thing to do would be to use the modulus operator like so:
awk 'length%2' file
Upvotes: 4