Everyone on the internet says you should use this:
if ($2 == "")
or this:
if (!length($2))
or this:
if (!$2)
All of these do not work for me. I got a csv
, separated by ";" with 2 columns. In some cases the second column is empty (I can see that in gedit).
I want to distinguish the 2 sets
in that file (2 sets = last column empty vs last column not empty
). If I just print length($2)
, I see that those lines where there is nothing in column 2 actually have a length of 1.
So there seems to be something in there, but I cannot see what it is?
How can I make that thing visible, which makes length equal to 1? It seems to be preventing those 3 expressions from above from matching.