On Tue, 2002-10-01 at 05:34, Janek Schleicher wrote:
> Matt Simonsen wrote at Tue, 01 Oct 2002 01:00:41 +0200:
> 
> > I need to get 2 fields out of a file which has the following format:
> > 

I put a real clip below ... should be more helpful.


> What is the exact data you want to separate.

I have an Opera bookmark file (clip below) that I want to create a hash
from - with NAME as the key and URL as the value.

> What have you tried already ?

I'm at the point of pseudo-code. My "best" solution right now goes open
file, use a while loop to read it, and use the following regular
expression to get the data:

%hash =  m/NAME=(.*)\nURL=(\S+)/gs

> Why do you think your ways are poor ?

While I think this would work it seems to me there should be something a
little better. Since I since I am just doing this for fun and am in no
hurry I can take the time to learn along the way.


#URL
        NAME=BSD Today - Your Daily Source for BSD News and Information
        URL=http://www.bsdtoday.com/
        CREATED=1008091383
        VISITED=1008874574
        ORDER=8

#URL
        NAME=Geekcorps Volunteer Bios - Dan DiNicolo
        URL=http://www.geekcorps.org/dan.html
        CREATED=1008177343
        VISITED=1008895132
        ORDER=9

#URL
        NAME=Perl Tutorial
        URL=http://archive.ncsa.uiuc.edu/General/Training/PerlIntro/
        CREATED=1008581519
        VISITED=1008842400
        ORDER=10


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to