Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Dec 2009
    Location
    Lemoyne, PA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a log file that is a text file that was forgotten about for too long and is now too large to open up. How can I split it into smaller text files? Btw, I don't use Word anymore, I have Open Office, as I can't keep up with Microsoft's prices.

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    Can you open it using Notepad?

    Gary

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by D Earl View Post
    I have a log file that is a text file that was forgotten about for too long and is now too large to open up. How can I split it into smaller text files?
    There might be a way to do this at the command line, or with WordPad.

    If you are willing to try a new (free) text editor, I suggest PSPad. You can use the Copy feature in the find dialog to copy out matching lines to a new document. That should let you create new files by date or some other useful criterion.

    Example using Copy feature with a date search in a 9MB a web server log file:
    [attachment=88875:PSPadFindCopy.png]
    Attached Images Attached Images

  4. #4
    New Lounger
    Join Date
    Dec 2009
    Location
    Lemoyne, PA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The file is much too large to copy out individual days, I would rather just split it into perhaps 10 individual files and keep them that way for reference. Btw, I downloaded Textpad at one point to try and open the file as Textpad claims to have an unlimited file size capacity. It seemed to do better than any of the other programs I have tried although my system still hung up trying to load the document (2.5 GB).

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    If editors do not work, I would try a VBScript file that reads the file one line at a time and writes them out to new files of a predefined number of lines. The following blog entry has a script that writes two files, the first of which contains 59,999 lines, and the second of which contains the rest: neil kilbride's blog: Split a text file with VBScript. To handle multiple output files, you would need to generalize this approach, maybe along the lines in this post: [vbscript-l ] Need to split one text file and produce separate files with maximum 64000 records each (2nd Response) - Toolbox for IT Groups. I haven't tested these myself, and Google has plenty more.

  6. #6
    New Lounger
    Join Date
    Jun 2010
    Location
    San Francisco, California, USA
    Posts
    13
    Thanks
    0
    Thanked 1 Time in 1 Post
    Word Pad can open larger files than Notepad. Give it a try.
    Mary
    MJN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •