> >>>I have a list of positive integers of which I only want the first one.
> >>>They are of arbitrary size. How can I cut the rest of them off?
> >>>I've been trying to write a regular expression for this using sed or
> >>> awk.
> >
> > you don't specify the format of the integers. are they space separated
> > and all on one line? or are they line separated (each integer on
> > its own line)?
> >
> > are there blank spaces (if the first) or blank lines (if the second)
> > before the first integer?
>
> Blank spaces are between the numbers.
>
In awk is pretty simple, just do:
awk '{ print $1 }' filename
(where filename is the name of the file with the numbers)
I'm assuming you have only one line in that file, if you have more than one
line and you want to specify which line to print do:
awk '{ if ( NR==line_number ) print $1 } filename
--
Toshiro
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com