[Gllug] printing and splitting IPs
dudes dudes
akam123 at hotmail.co.uk
Wed Sep 28 13:39:44 UTC 2011
Hello again,
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
/* many thanks for any suggestions */
111.111.111.111
22/ open
23/ open
80/ open
113/ closed
179/ open
443/ open
541/ open
1723/ open
172.16.8.2
22/ open
80/ open
135/ open
139/ open
172.16.8.12
21/ open
25/ open
80/ open
111/ open
135/ open
thanks for your time
ak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20110928/d39cc0e1/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