Hongyi Zhao wrote: > Hi all, > > I want to write a script to note specific IP > addresses by appending the corresponding location informations. For > detail, I describe my issue as follows: > > Suppose I have two files, the first file is used to store the specific > IP > addresses which I want to note, and the second file is used to store > the IP database along with the corresponding location informations. > > The first file has one IP address per line with dotted decimal format, > e.g.: > > 0.125.125.125 > 4.19.79.28 > 4.36.124.150 > ... > > The second file has four field per line delimited by CHARACTER > TABULATION (U+0009). These four field are: StartIP, EndIP, Country, > and Local, e.g.: > > StartIP EndIP Country Local > 0.0.0.0 0.255.255.255 IANA CZ88.NET > 4.19.79.0 4.19.79.63 American Armed Forces > Radio/Television > 4.36.124.128 4.36.124.255 American Technical Resource > Connections Inc > ... > > Based on the second file, I want to reformat the first file by > appending the corresponding location informations for each IP address > in it, i.e., for the above example, I want to obain the following > result: > > 0.125.125.125#IANA CZ88.NET > 4.19.79.28#American Armed Forces Radio/Television > 4.36.124.150#American Technical Resource Connections > ... > > Any hints on this issue will be highly appreciated. > Thanks in advance.
Is the IP address you're interested in the StartIP, the EndIP, or both? -- Just my 0.00000002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. I like Perl; it's the only language where you can bless your thingy. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/