Search Results

Search: Posts Made By: Scrutinizer
6,251
Posted By Scrutinizer
Nice use of RT, however RT is GNU awk only. ...
Nice use of RT, however RT is GNU awk only.

Here is another option using RS=, which should work with any POSIX awk:
awk 'p{printf "| (%s) %s ",s p,p; s=s p RS } {p=$1} END{print "| " p}' RS=,...
6,251
Posted By Scrutinizer
Hi, thanks for the puzzle :) awk '{s=x;...
Hi, thanks for the puzzle :)

awk '{s=x; for(i=1; i<=NF-1; i++) {s=s (s?FS:"(") $i; $i=s ") " $i " " }}{sub(" $",x); print x,$0}' FS=, OFS='| ' file
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 10:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy