Search Results

Search: Posts Made By: Scott
2,730
Posted By Scott
My example didn't have the field separator. ...
My example didn't have the field separator.


$ awk -F\t -f what.awk what.txt


But it is definitely == :)

= would give you every line back, regardless of number of fields.
2,730
Posted By Scott
= is wrong. It will assign 2 to NF, not test if...
= is wrong. It will assign 2 to NF, not test if the value of NF is 2.
2,730
Posted By Scott
The contents of what.awk, I imagine, should be: ...
The contents of what.awk, I imagine, should be:


NF == 2 {print $1, "[LABEL=" $2 "]"}



$ cat what.awk
NF == 2 {print $1, "[LABEL=" $2 "]"}

$ cat what.txt
a b
c d e f
g h

$ awk -f...
2,730
Posted By Scott
This NF = 2 should be this NF == 2. "It...
This NF = 2 should be this NF == 2.

"It gives me errors" is no help. What errors?
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 07:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy