Is this a bug?
$ cat tst.awk
BEGIN { FPAT="[^,]*" }
{
print NF, $0
for (i=1;i<=NF;i++)
print "\t" i, "[" $i "]"
print ""
}
$ cat -v file.csv
,,3
,,3
$ awk -f tst.awk file.csv
3 ,,3
1 []
2 []
3 [3]
2 ,,3
1 []
2 [3]
Note that awk recognizes 3 fields in the first line but only 2 in the second.
If it's not a bug - what's causing that behavior?
$ gawk --version
GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.5, GNU MP 6.1.2)
Copyright (C) 1989, 1991-2016 Free Software Foundation.
$ $SHELL --version
GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)
Copyright (C) 2016 Free Software Foundation, Inc.
Regards,
Ed.