Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by punkish (Priest)
on Apr 10, 2010 at 00:35 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://833928]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-24 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found