On a Windoze XP computer I put
[tt]
BEGIN{OFS="|"}
$1=$1
[/tt]
in a file and ran awk, mawk, and gawk with [tt] -f t.awk file[/tt]. It worked with all three.
A star to vlad for his very terse solution. Even the "-v" can be eliminated:
Code:
mawk '$1=$1' OFS='|' inputFile
When one of the "filenames" is of the form var=text, it is recognized as an assignment and is performed at the time that argument would be accessed as a file.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.