Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

print columns into a one column

0 views
Skip to first unread message

Sally

unread,
Dec 27, 2009, 10:15:48 PM12/27/09
to
Hi,

How can i print multiple columns in one file into one column in a
file?

Ex.

12 13 14 15
22 22 22 22
33 33 33 33

to

12 14
22 22
33 33
13 15
22 22
33 33

I want to combine column 1 and 2 to one column and column3 and 4 to
one column.

Thanks.

Sally

unread,
Dec 27, 2009, 10:24:52 PM12/27/09
to

Janis Papanagnou

unread,
Dec 28, 2009, 5:55:55 AM12/28/09
to

awk '
{ print $1" "$3; a[NR]=$2" "$4 }
END { for (i=1; i<=NR; i++) print a[i] }
'

Janis

>
> Thanks.

0 new messages