Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
- The problem statement, all variables and given/known data:
Here in flwng code \n is not working
- Relevant commands, code, scripts, algorithms:
Files: a.txt
This is test line
End of line
a.sh
a.awk
- The attempts at a solution (include all code and scripts):
the code i tried;
a.sh:
awk -f a.awk a.sh
a.awk:
BEGIN{
l=0
w=0
c=0
}
{
n=length($0)
for(i=1;i<=n;i++)
{
ch=substr($0,i,1)
if(ch==" " || ch=="\n")
w++
else if(ch=="\n")
l++
else
c++
}
}
END{
print("lines=",l)
print("words=",w)
print("characters",c)
}
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Sp university
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).