Search Results

Search: Posts Made By: stdroid
1,370
Posted By Scrutinizer
Another approach, but more as an exercise because...
Another approach, but more as an exercise because it lacks clarity:
awk '{p=$0; n=NF; for(i=3; i<=n ;i++) {$0=p; $i=x; $0=$0; $2=$2 " (-" i-2 ")"; print}}' file | sort -k3,3 -k1,2
1,370
Posted By RudiC
Does the output order matter? Try awk ' ...
Does the output order matter? Try awk ' {for (i=3; i<=NF; i++) {printf "%s", $1 FS $2 FS "(-"i-2")"
for (j=3; j<=NF; j++) if (i!=j) printf " %s",...
Showing results 1 to 2 of 2

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