Hi,
I've tried searching through the forum but I've drawn a blank so i'm going to post here. I'm developing a number of checks on a CSV file, trying to find if any are greater than a max limit. I'm testing it by running it from a command line.
The file I'm testing has 8 records. When I perform a print of the length of the field I want to check I get this:
z:\clientfiles>awk -F, '{print length($1)}' 131112_143889b.csv
4
3
3
3
3
3
3
0
When I use the Equal operator as a check, I return the results I expect:
z:\clientfiles>awk -F, 'length($1) == 4 {print length($1)}' 131112_143889b.csv
4
But when I use the Greater than or Equal to operator, I don't understand why I'm not getting back any records?
z:\clientfiles>awk -F, 'length($1) >= 4 {print length($1)}' 131112_143889b.csv
z:\clientfiles>awk -F, 'length($1) >= 0 {print length($1)}' 131112_143889b.csv
z:\clientfiles>
I've tried using the int() and +0 as suggested in other answers in case one of the figures is being treated as a string, but I've hit a wall and not sure what to do next? Can anyone suggest anything? Apologies if I've made a really beginner mistake and can't see it.