FileSplitter Tool in C#

File Splitter Utility in C#

I had to come across a situation where I had to cut a large single .csv file containing 2.2 Million records into smaller files. Initially I thought of using already available split tool to do it, but then decided to write my own File Splitter tool in C#.  Thats how I came up with this tool. The File Splitter Tool takes an input file and splits it into multiple files each containing the number of records you specify. Here is the source code for the tool.


Why am I not able to Move to the Begin of Stream using the Seek() Method in StreamReader?

As you use StreamReader to manipulate Text files and read one line at a time using Readline() Method you might come across a situation where you are somewhere in the middle of the Stream say on the 5th line and want to go back to the begin of the Stream. You can do that using the Seek Method on the BaseStream of the StreamReader as in this example.