Hi,
Does any one know how to avoid the scenario where awk ignores the fields having only spaces or empty fields?
for instance,
Data: "a","b","c","d",""," "
code:
awk -F, '{ print NF }' File
the output I get is 4 instead of 6 do you know how to avoid this?
# cat file
Data: "a","b","c","d",""," "
# awk -F, '{ print NF }' file
6
still doesnt work. I am working on AIX
Its working for me in AIX v6
$ echo '"a","b","c","d",""," "' | awk -F, '{ print NF }'
6
Which version are you using?
its version 5. not sure why it is misbehaving.
joeyg
6
cat file | tr "," "\n" | wc -l
Sorry - I realized later that the empty fields are just nulls.