http://www.perlmonks.org?node_id=833928


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.