Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991043]
help
Chatterbox?
[marto]: only at work 3 days this week, then off to Copenhagen for a wedding
[marto]: back the following Monday, potentially gone 2-3 days the next week for work
[Corion]: Oh - "Cyber Monday" week is coming up... That's why weird stuff is already discounted now...
[Corion]: marto: Oh, cool, I hope you get to enjoy the trip and Copenhagen! I found it nice (but the mermaid is underwhelming)
[marto]: the kids and their mother are coming too, actually only 9 people at the wedding in total. Still, will be fun

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2017-11-19 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (280 votes). Check out past polls.

    Notices?