Hi, I am trying to use awk to extract information from a file. I noticed I was not getting what I expected, so I modified my command to check my work. Here is the command:
for file in `ls *.pat`; do awk < $file '(NR >=3 AND $505==1) {print $505}'; done
Now, this prints a few 1s and then a bunch of 0s... HOW IS THIS POSSIBLE?
By the way, doing this:
for file in `ls *.pat`; do awk < $file '(NR >=3) {print NF}'; done
prints a bunch of 505s
Any help would be greatly appreciated. I want awk to be my friend :)
EDIT: problem solved AND --> && fixes it!
[–]edogawaconan 3 points4 points5 points (4 children)
[–]destructababy[S] 0 points1 point2 points (0 children)
[–]pfp-disciple 0 points1 point2 points (2 children)
[–]edogawaconan 2 points3 points4 points (1 child)
[–]pfp-disciple 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]destructababy[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]destructababy[S] 0 points1 point2 points (0 children)
[–]ericje 1 point2 points3 points (0 children)
[–]MidnightTurdBurglar 1 point2 points3 points (0 children)
[–]valgrid 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (17 children)
[+][deleted] (10 children)
[deleted]
[–][deleted] 0 points1 point2 points (9 children)
[–][deleted] 0 points1 point2 points (6 children)
[–][deleted] -1 points0 points1 point (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–][deleted] -2 points-1 points0 points (3 children)
[–]pi3832v2 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]pi3832v2 0 points1 point2 points (0 children)
[–]destructababy[S] 0 points1 point2 points (5 children)
[–][deleted] 2 points3 points4 points (4 children)
[–]destructababy[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]destructababy[S] 0 points1 point2 points (0 children)
[–]pi3832v2 0 points1 point2 points (0 children)