Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Regex copy and paste help

by talexb (Canon)
on Aug 31, 2012 at 16:58 UTC ( #991043=note: print w/ replies, xml ) Need Help??


in reply to Regex copy and paste help

This brings back nice memories, because it closely resembles the problem I solved as part of my first paying Perl gig, and that led to a contract that lasted about three years, back in about 1998.

As has already been explained, just collect the lines, putting each line into an array (I would use an array of arrays, or AoA). You could merge the continuation lines as you go, or you could do it at the end -- if a line has a '-' in the second column, replace that with whatever's in the next line's second column.

I also had to deal with headers and footers, but they were easier.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds


Comment on Re: Regex copy and paste help

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991043]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2014-09-17 03:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (57 votes), past polls