Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: breaking a text file into a data structure -- best way?

by punkish (Priest)
on Apr 10, 2010 at 00:35 UTC ( #833928=note: print w/ replies, xml ) Need Help??


in reply to Re: breaking a text file into a data structure -- best way?
in thread breaking a text file into a data structure -- best way?

Thanks for the response, but you misunderstood my task. The 'a>', 'b>', 'c>' are not really present in the text file. I included them as "line numbers" to illustrate where I wanted the text split up. In the specific case I presented, the text is split up at the line *before* the line that starts with '======'.

In any case, I am curious about a general approach to such problems, and at first glance, it seems that a state machine approach would help me. However, I got stuck with that as well, especially since my splitting markers are not *in* the line where I want to split the text, but *after* the line on which I want to split.

--

when small people start casting long shadows, it is time to go to bed


Comment on Re^2: breaking a text file into a data structure -- best way?
Replies are listed 'Best First'.
Re^3: breaking a text file into a data structure -- best way?
by rubasov (Friar) on Apr 10, 2010 at 03:42 UTC
    but you misunderstood my task
    Indeed. In the last days I'm doing really stupid things, sorry.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (14)
As of 2015-07-30 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls