Is there a tool to split large text file (9 GB) into smaller files, so that I can open it and look through?
Is there anything usable from the command line that comes with Windows (XP)?
Or what's the best way to split it? Can I use 7-Zip 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?
I put together a quick 48-lines Python script that splits the large file into 0.5 GB 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.
grep -n
withhead
andtail
to see chunks of the file. Example,grep -n "something" file.txt
returns95625: 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
.