FS variable in awk

I was reading about environment variables and I also found this article Internal Variables that describes the variables used by bash. In reading that I learned about the awk FS variable which aids in field splitting. See page 146 of sed & awk by Dougherty and Robbins for details, but basically you can set FS to a single character to have lines split into fields based on that character, or you can specify a regular expression such as “\t+” (any number of tabs separates fields) or “[,;]” (a single comma or fullstop will separate fields).

This entry was posted in Programming and tagged , by Jay Jay. Bookmark the permalink.

About Jay Jay

Hi there. My name is John Elliot V. My friends call me Jay Jay. I talk about technology on my blog at blog.jj5.net and make videos about electronics on my YouTube channel @InTheLabWithJayJay.

Leave a Reply