[PLUG] awk: is field blank?
Robert Citek
robert.citek at gmail.com
Sat Oct 30 15:41:45 UTC 2021
Hello Rich,
Here's a sample:
$ echo -e "a\tb\tc\td\na\tb\t\td" | awk -F'\t' '{print}'
a b c d
a b d
$ echo -e "a\tb\tc\td\na\tb\t\td" | awk -F'\t' '$3=="" {print}'
a b d
Good luck and let us know how it goes.
Regards,
- Robert
On Sat, Oct 30, 2021 at 9:31 AM Rich Shepard <rshepard at appl-ecosys.com>
wrote:
> I've a 351K line file with 8 fields. About 50K of those lines has $8 blank.
> I want awk to print only rows with values in all 8 fields. I'm not finding
> how to tell awk to print $0 if $8 is not blank.
>
> My awk/sed book doesn't seem to have this information and my web searches
> aren't finding the answer, either.
>
> Clue needed.
>
> Rich
>
More information about the PLUG
mailing list