I have not updated my blog for almost seven months. The main reason is that I am making some big move! I am getting into finance! I have been preparing my Charted Financial Analyst exams for months.
Anyway, I need to write about CFA in another post, so I’d better talk about text file splitter. I have a very simple need, split a big text file that is over 1GB into small pieces so I can only them with text editors. My first take is to download some freeware, but I was out of luck, and people charge $10-$30 USD for such a simple task! Jeez. I have found some free chinese file splitter, but they all crash upon opening the file. The reason they crush because they all load the whole text file for preview first, which does not make any sense imho.
I have found some source code online but most of them advertised as “untested”, so I decided not to read them. After spending hours of researching and having tried more than 20 software, I decided to write my own.
You can download the app here (no need to install, just run it as long as your computer has .NET 2.0 installed):
Text File Splitter By Number of Lines (binary)
You can download my C# source code (VS2005 sln) at:
Text File Splitter By Number of Lines (source code)
(I was in a rush, so I mistakenly named my app as “text splitters”. Please forgive my grammatic mistake.)
I have not implemented a good checking mechanism such as using “try…catch…” because I only have one file to split. The speed is not bad: I have splitted a large text file (250MB) into 302 files (each has 10,000 lines) in just one minute.
My code is absolutely free (well, it only takes me less than an hour to create this, so I don’t think I deserve $10).
If this app works for you, please link to my app on your blog so more people can use it without paying (saddly, those who charge for this have very good google ranking) .
Source: chenty