![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Code:
awk '
NR==1{p1=$1;p2=$2;getline;printf("(%s-%s)%s(%s-%s)\n",p1,$2,OFS,p2,$1);q1=$1;q2=$2;next}
{printf("(%s-%s)%s(%s-%s)\n",q1,$2,OFS,q2,$1);q1=$1;q2=$2}' file
-Devaraj Takhellambam |
| Sponsored Links | ||
|
|