in reply to How do I sort a file with IP Addresses and another text column?
print map{sprintf(("%d.%d.%d.%d,"x2)."%s\n",(split/,/)[1..8,0])} sort map{sprintf"%s".",%3d"x8,(split/\W/)[8,0..7]} <DATA> __DATA__ 1.2.3.4,1.2.3.255,USA 2.3.4.0,2.3.4.25,USA 124.2.3.0,124.2.3.255,Argentina
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: How do I sort a file with IP Addresses and another text column
by Saint Aardvark (Acolyte) on Jan 25, 2002 at 04:18 UTC |