Is there a tool to split large text file (9Gb) into smaller files so that I can open it and look through.

Anything usable from command line that comes with Windows (XP)?

Or what's the best way to split it. Can I use 7z to create separate volumes and then unzip one of them separately? Will it be readable or does it need all the other parts to unzip into the big file again?

Thanks

Edit: Thanks for responses.

I put together quick 48 lines python script that split the large file into 0.5GB files which are easy to open even in vim. I've just needed to look through data towards the last part of the log (yes it is a log file). Each record is split across multiple lines so grep would not do.

link|improve this question
I see you edited to mention grep. Do you have cygwin or unxutils installed? You could have used grep -n with head and tail to see chunks of the file. Example, grep -n "something" file.txt returns 95625: something. You want to see that line and 9 lines below it for a total of 10 lines: head -n 95635 file.txt | tail -n 10. – John T Jan 11 '10 at 4:10
feedback

migrated from serverfault.com Jan 11 '10 at 1:25

This question came from our site for system administrators and desktop support professionals.

3 Answers

up vote 2 down vote accepted

There is a freeware Windows file splitter called HJSplit 2.4

Available here. The website claims it can split files of any type and size, but 9GB is a big file.

link|improve this answer
feedback

Another is GSplit - according to their site it can split very large files (larger than 4Gb <-- since they crossed the 4Gb limit, I guess they can do 9 Gb as well).

But, another thing - you say you want to split it into smaller parts so you can open it up and look at it. That sounds like a very big perhaps log file.

In any case, for opening large text files, may I recommend EmEditor - they claim themselves it can open very large files (up to cca. 250 Gb), and I've used it in the past for files up to 2 Gb. But in any case, I think it may be a better solution than splitting.

link|improve this answer
feedback

Check out Large Text File Viewer, it's great for things like this. Most archivers and splitters will separate the file into pieces which cannot be used to read each piece of data independently and properly, you need to extract them all to get the file back.

alt text

Large Text File Viewer is free and portable.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.