I want to count all the lines in a file with a byte in the line greater than the value (say 10). How can i do this?
I tried using cat file | awk'length($0)>10', but it gives me all the lines with char greater than 10. I want to count the bytes in the line.
I wrote the code below, but it does not work. It returns some output of tablets:
#!/bin/ksh
file="a.txt"
while read line
do
a=`wc -c "${line}"|awk {'print $1'}`
if [ $a -ne 493]; then
echo "${line}"
fi
done <"$file"
source
share