Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Regex copy and paste help

by MidLifeXis (Prior)
on Aug 31, 2012 at 12:44 UTC ( #990997=note: print w/ replies, xml ) Need Help??


in reply to Regex copy and paste help

This looks similar to what I see in sqlplus when data is wider than a format allows for. Is there any way to change the width of your formats when generating the data to make your parsing easier?

Then next question I would ask is if the gaps between columns are tabs or spaces. I would use split, a regular expression or substr to pull out the data for each column.

After I had the columnized data for each row, I would feed the data into a state machine. If @current_line[0] == @last_line[0], then you have a multi-line parsing situation (although, having nothing in the first column seems to indicate the same thing). Build up your data for each record, and print out the processed information once the record is complete.

If you show some code, you will be led along the path to enlightenment.

--MidLifeXis


Comment on Re: Regex copy and paste help
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2014-12-26 14:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls