Toggle navigation
Log in
Sign Up
Log in
Sign Up
Appium
C
C#
C++
Docker
Go
Informatica
Java
JavaScript
Kafka
Numpy
Oracle
Pandas
PHP
Python
R
React Native
Scipy
SFTP
Tableau
Teradata
TGMC
UNIX
Forget_Code.Models.CategoryViewModel
Add a new snippet
AWK
1
Choose Category
OFS - Output Field Separator in UNIX
Forget Code
UNIX
OFS - Output Field Separator
OFS is a AWK built-in variable used to change the output field separator.
Exmple Usage : OFS can be used to convert space separated file into colon separated file
file.txt contains
sam 80
merlin 90
ray 85
awk 'BEGIN{OFS=":";}{print $1,$2;}' file.txt
Output
sam:80
merlin:90
ray:85
Note : OFS will not be applied when print $1 $2 is used , is mandatory and OFS will not be used if print $0 is used.
Tags for OFS - Output Field Separator in UNIX
unix output field separator
unix ofs output
ksh ofs output field separator
kornshell OFS output file seperator
awk output field separator
awk ofs
awk -F, OFS=
Contribute to Forget Code, help others.
Add snippet