[Gllug] printing and splitting IPs
dudes dudes
akam123 at hotmail.co.uk
Wed Sep 28 17:21:05 UTC 2011
thanks for your explanation Tet. You are very right :)
> Date: Wed, 28 Sep 2011 15:08:08 +0100
> From: tethys at gmail.com
> To: gllug at gllug.org.uk
> Subject: Re: [Gllug] printing and splitting IPs
>
> On Wed, Sep 28, 2011 at 2:39 PM, dudes dudes <akam123 at hotmail.co.uk> wrote:
>
> > I've got a file with IPs and port numbers. I'm trying to split this file
> > into different separate files based on the IP addresses and associate port
> > numbers to file1, file2, file(n+1.) I'm issuing this statement, but it
> > failed.
> >
> > awk '/^*.*.*.*/{close("file"f);f++}{print $0 > "file"f}' file
>
> You're using a glob pattern, where awk requires regular expressions.
> Change it to:
>
> awk '/^.*\..*\..*\..*/{close("file"f);f++}{print $0 > "file"f}' file
>
> Tet
>
> --
> "Java is a DSL for taking large XML files and converting them to stack
> traces" -- Bulat Shakirzyanov
> --
> Gllug mailing list - Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20110928/096c0610/attachment.html>
-------------- next part --------------
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list