March 2018
Beginner to intermediate
416 pages
9h 24m
English
The default value of the output field separator (OFS) is space. It is the output equivalent of the FS. We can set any string of characters to be used as the OFS by setting the predefined variable to OFS. The OFS is generated when we put a comma in the print statement to separate the arguments. For example, when we print the field without using a comma, then each of the field values are written contiguously in the output, as follows:
$ awk '{print NR"." $1 $3 $4}' emp.dat
The output of the execution of this code is as follows:
1.Jack9857532312jack@gmail.com2.Jane9837432312jane@gmail.com3.Eva8827232115eva@gmail.com4.Amit9911887766amit@yahoo.com5.Julie8826234556julie@yahoo.com6.Ana9856422312anak@hotmail.com7.Hari8827255666hari@yahoo.com ...
Read now
Unlock full access