I have a problem using awk. Print, from every file given as a parameter, the number of line that has the length at least 10. Also, print the content of that line(s), except the fist 10 characters. At the end of the analysis of a file print the name of the file and the number of lines printed.
This is what I've done so far:
{
if(length($0)>10)
{
print "The number of line is:" FNR
print "The content of the line is:" substr($0,10)
s=s+1
}
x= wc -l //number of lines of file
if(FNR > x)
{
print "This was the analysis of the file:" FILENAME
print "The number of lines with characters >10 are:" s
}
}
This prints the name of the file and the number of lines after every line that has at least 10 characters but I want something like this:
print "The number of line is:" 1
print "The content of the line is:" dkhflaksfdas
print "The number of line is:" 3
print "The content of the line is:" asdfdassaf
print "This was the analysis of the file:" awk.txt
print "The number of lines with characters >10 are:" 2