[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: awk FIELDWIDTHS howto?



2008/1/9, Paul Csanyi <csanyipal@gmail.com>:
> Hello!
>
> I try to use awk to print second field from a text file
> but awk prints a part of 1. field as a 2. field. Why?
>
> aptitude search ~i | awk '{ NF = "2" } { FIELDWIDTHS = " 4 32 " }
> {print $2}' > foltelepitett_debian_csomagok
>
> less foltelepitett_debian_csomagok
>
> ..
> bsdmainutils
> bsdutils
> busybox
> A
> ca-certificates
> checksecurity

Hello,

something like this:   aptitude search ~i | cut -d" " -f2

does this help you ?

Best regards,
Sergio Cuellar

-- 
"Meine Hoffnung soll mich leiten
Durch die Tage ohne Dich
Und die Liebe soll mich tragen
Wenn der Schmerz die Hoffnung bricht"


Reply to: