cut and append

cut and append

Post by uscdieh.. » Sun, 17 Sep 2000 04:00:00



How can I cut the 3rd colomn(hex values) of this input and place it on
every 3rd line?

ASD sdd1 10
XXW sft1 FF

JQW sde2 09
WQZ sdg2 de

out:

ASD sdd1 10
XXW sft1 FF
10      FF

JQW sde2 09
WQZ sdg2 de
09      de

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

cut and append

Post by Kenny McCorma » Sun, 17 Sep 2000 04:00:00



>How can I cut the 3rd colomn(hex values) of this input and place it on
>every 3rd line?

>ASD sdd1 10
>XXW sft1 FF

>JQW sde2 09
>WQZ sdg2 de

>out:

>ASD sdd1 10
>XXW sft1 FF
>10  FF

>JQW sde2 09
>WQZ sdg2 de
>09  de

1
NR % 3 == 2 { print old3,$3 }
{ old3 = $3 }