Mipos xerei kaneis?

Giorgos Keramidas keramida at ceid.upatras.gr
Fri Mar 31 20:56:30 EEST 2006


On 2006-03-31 20:51, "m65 at vivodinet.gr" <m65 at vivodinet.gr> wrote:
> Exo afti ti grammi
> mysql.log|1.87|1.93|1.81|1.87|18.572 |2004-12-11|linux.so
>
> Exo afto:
>
> BEGIN { RS = "|" ; FS = "\n" }
>
> {
>        print "Name is:",$7
> }

Exeis ta RS kai FS anapoda.  Gia thn awk(1) ena 'record' einai to $0
(olh h grammh), kai ena 'field' einai ayto pou thes esy...

> Den tha eprepe me tin awk -f str.awk mysql_log.csv | more
> na epestrefe to 7o pedio, diladi tin imerominia?
> Dokimasa kai $6, den evgale tipota.
> Mono an peraso to $1, pou epistrefi OLA ta pedia. Diladi den ta xehorizi
> opos katalaveno.
> ?

Dokimase ayto:

$ cat -n str.awk
     1  BEGIN { FS="|"; }
     2  { print "Name is:",$7 }
$ echo 'mysql.log|1.87|1.93|1.81|1.87|18.572 |2004-12-11|linux.so' | awk -f str.awk
Name is: 2004-12-11
$




More information about the Linux-greek-users mailing list