R
Ruby Newbee
Hello,
I have been using awk for some text handling.
Now I'm beginning Ruby (really newbie) and want to find a way in ruby
to do this with awk:
awk '{if ($4~/something/) {i+=1}} END {print i}' file.txt
That means if a line's 4th field match "something" then increase the
counter by 1.
How to write the corresponding ruby code?
Thanks in advance.
I have been using awk for some text handling.
Now I'm beginning Ruby (really newbie) and want to find a way in ruby
to do this with awk:
awk '{if ($4~/something/) {i+=1}} END {print i}' file.txt
That means if a line's 4th field match "something" then increase the
counter by 1.
How to write the corresponding ruby code?
Thanks in advance.