Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 471 Bytes

set-separator-between-print.md

File metadata and controls

13 lines (8 loc) · 471 Bytes

Set separator between print statements in awk

To set the separator between print statements in awk, set the ORS variable:

awk 'BEGIN { ORS=" " }; {print $1; print $2; }'

This will separate both print statements by an empty space.

See this discussion on Stack Overflow. For more information, read the awk man page.