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

Re: Splitting a file based on matched conditions

by roboticus (Chancellor)
on Sep 19, 2017 at 15:56 UTC ( #1199683=note: print w/replies, xml ) Need Help??


in reply to Splitting a file based on matched conditions

skumar_pm:

You could just read the file in as a single string, then break it into chunks with regular expressions. Then examine the chunks to decide which array you want to put them.

Alternatively, you could change the input record delimiter to '\nStart:' and read them a chunk at a time, then again, examine each chunk to decide where to put them.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: Splitting a file based on matched conditions

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2018-09-23 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (191 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!