Mipos xerei kaneis?

m65 at vivodinet.gr m65 at vivodinet.gr
Fri Mar 31 21:04:18 EEST 2006


Giorgos Keramidas wrote:
> 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
> $
> 
Se efharisto kai pali!

BEGIN { FS = "|" }

{
       print "Name is:",$7
}

Doulepse etsi! :-)
Alla ti diaolo lene sto loria.fr? To site tous oti leei einai lathos tote!
Ti pezi genika me tin awk? Giati diavaza oti blekei me regexp, kai itan 
kati pou me tromaxe :-(
Eheis kana kalo link? gia perissotera kai pio akrivestera?



More information about the Linux-greek-users mailing list