Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Splitting a large file into smaller files according to indexes

by bliako (Monsignor)
on Apr 05, 2018 at 23:32 UTC ( [id://1212392]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Splitting a large file into smaller files according to indexes
in thread Splitting a large file into smaller files according to indexes

it is initialised to -1 (or whaterver other value your mrule number will not take) in order to force the opening of the file upon seeing the mrule pattern for the first time.

Glad it worked (it's Perl after all) but I stress that it is untested by me for more complex cases.

bliako
  • Comment on Re^3: Splitting a large file into smaller files according to indexes

Replies are listed 'Best First'.
Re^4: Splitting a large file into smaller files according to indexes
by bliako (Monsignor) on Apr 06, 2018 at 12:23 UTC

    As an example of where the above program may go wrong, consider what happens if mrule=140 appears in two different parts of your log file - NOT consecutively, i.e. another mrule line is in between. The last time's contents will overwrite the first time's contents!

    bliako

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-23 20:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found