>_ IzzyLab

Topic breakdown

awk has two field separators: FS (input field separator) defines what to split the input by, while OFS (output field separator) defines what to glue fields together with when printing; both are set in the BEGIN block, which runs before the file is read. The subtlety: awk rebuilds a line with the new OFS only if you touch some field — merely changing OFS does not reformat the line by itself. Hence the separator-conversion idea: change FS/OFS and force awk to rebuild the record by touching a field, then print the line.

What's checked

  1. fields are tab-separated

What it looks like