Field Separator
noun
say it: “FEELD SEP-uh-ray-ter” /ˈfild ˈsɛpəreɪtər/
The character a tool splits each line at to find its pieces, such as a space or a comma.
What is a field separator?
A field separator is the character a tool splits each line at to find its fields. awk splits at spaces unless you give it another one with -F: -F, (read "F comma") splits a CSV file at its commas, so $3 is the third column.
awk -F, '{ print $3, $NF }' orders.csv | head -n 2
# item total
# sourdough loaf 14.00
In a sentence
- “With the field separator set to a comma, $3 was the item column.”
- “awk's field separator is a space until you give it -F, for a CSV file.”
Level: Apprentice · More Unix terms at this level
Updated