Re: problem with awk

2010-06-02 Thread Aaron Konstam
On Wed, 2010-06-02 at 13:41 -0500, Dave Ulrick wrote: > On Tue, 1 Jun 2010, Aaron Konstam wrote: > > > On Tue, 2010-06-01 at 17:08 +0100, Adel ESSAFI wrote: > >> Hello, > >> I have a "little" proble with awk > >> here I have a file which contain data like this > >> > >> > >> 101663.dat > >> 1 12

Re: problem with awk

2010-06-02 Thread Terry Polzin
On Wed, 2010-06-02 at 13:44 -0500, Dave Ulrick wrote: > On Tue, 1 Jun 2010, Dave Ulrick wrote: > > > Looks like a field separator (FS) problem. The field separator is used by > > 'awk' to divide a line into fields. The default 'awk' field separator is > > "\t" (tab) but your fields are separat

Re: problem with awk

2010-06-02 Thread Dave Ulrick
On Tue, 1 Jun 2010, Dave Ulrick wrote: Looks like a field separator (FS) problem. The field separator is used by 'awk' to divide a line into fields. The default 'awk' field separator is "\t" (tab) but your fields are separated by spaces. Try adding this inside the BEGIN {} block: FS = "

Re: problem with awk

2010-06-02 Thread Dave Ulrick
On Tue, 1 Jun 2010, Aaron Konstam wrote: > On Tue, 2010-06-01 at 17:08 +0100, Adel ESSAFI wrote: >> Hello, >> I have a "little" proble with awk >> here I have a file which contain data like this >> >> >> 101663.dat >> 1 122837.920343696 >> 1 121875.899726134 >> 1 8011.13164749145 >> 1 24955.11029

Re: problem with awk

2010-06-01 Thread Aaron Konstam
On Tue, 2010-06-01 at 17:08 +0100, Adel ESSAFI wrote: > Hello, > I have a "little" proble with awk > here I have a file which contain data like this > > > 101663.dat > 1 122837.920343696 > 1 121875.899726134 > 1 8011.13164749145 > 1 24955.1102952732 > > > when I execute > > awk'BEGIN { }

Re: problem with awk

2010-06-01 Thread Dave Ulrick
On Tue, 1 Jun 2010, Adel ESSAFI wrote: Hello, I have a "little" proble with awk  here I have a file which contain data like this 101663.dat 1 122837.920343696 1 121875.899726134 1 8011.13164749145 1 24955.1102952732 when I execute awk    'BEGIN { }   echo $2   END   { print "Fin" }

Re: problem with awk

2010-06-01 Thread suvayu ali
On 1 June 2010 09:08, Adel ESSAFI wrote: > I got this outpout > > 1 122837.920343696 > 1 121875.899726134 > 1 8011.13164749145 > 1 24955.1102952732 > > while I am expecting to get > > 122837.920343696 > 121875.899726134 > 8011.13164749145 > 24955.1102952732 > > without 1 at the beginning of the li

Re: problem with awk

2010-06-01 Thread Roberto Ragusa
Adel ESSAFI wrote: > Hello, > I have a "little" proble with awk > here I have a file which contain data like this > > > 101663.dat > 1 122837.920343696 > 1 121875.899726134 > 1 8011.13164749145 > 1 24955.1102952732 > > > when I execute > > awk'BEGIN { } > echo $2 > END { pri