• How do I split a large text file?

    Author
    Topic
    #469271

    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.

    Viewing 4 reply threads
    Author
    Replies
    • #1226428

      Can you open it using Notepad?

      Gary

    • #1226444

      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[/url]. 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:

    • #1226647

      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).

    • #1226730

      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.

    • #1228069

      Word Pad can open larger files than Notepad. Give it a try.
      Mary

    Viewing 4 reply threads
    Reply To: How do I split a large text file?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: