Anonymous user
String Character Length: Difference between revisions
→[[AWK]]
No edit summary |
|||
Line 21:
==[[AWK]]==
[[Category:AWK]]
From within any code block:
x=length("Hello," s " world!") # dynamic string example
y=length($1) # input field example
z=length(s) # variable name example
Ad hoc program from command line:
echo "Hello, world!" | awk '{print length($0)}'
From executable script: (prints for every line arriving on stdin)
#!/usr/bin/awk -f
{print"The length of this line is "length($0)}
==[[C]]==
|