Split big log file into Smaller one.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tommyboy1992
    New Member
    • Sep 2013
    • 1

    #1

    Split big log file into Smaller one.

    I have a huge text file that look like this:

    2013/255-12:23:34 - Some event happen
    2013/255-12:23:34 - Some event happen
    2013/255-12:23:34 - Some event happen
    2013/255-12:23:34 - Some event happen
    2013/256-12:23:34 - Some event happen
    2013/256-12:23:34 - Some event happen
    2013/256-12:23:34 - Some event happen
    2013/256-12:23:34 - Some event happen
    2013/257-12:23:34 - Some event happen
    2013/257-12:23:34 - Some event happen

    I would like to use perl to split this file into smaller files with the date as file name.

    So I would look like this when done:

    2013_255.txt will contain:

    2013/255-12:23:34 - Some event happen
    2013/255-12:23:34 - Some event happen
    2013/255-12:23:34 - Some event happen
    2013/255-12:23:34 - Some event happen

    2013_256.txt will contain:

    2013/256-12:23:34 - Some event happen
    2013/256-12:23:34 - Some event happen
    2013/256-12:23:34 - Some event happen

    2013_257.txt will contain:

    2013/257-12:23:34 - Some event happen
    2013/257-12:23:34 - Some event happen

    Thanks,
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    We are not a code writing service, but we will help you troubleshoot your code.

    What have you tried?

    What part is giving you trouble?

    What errors/warnings are you getting?

    Comment

    Working...