65.9K
CodeProject is changing. Read more.
Home

VB.Net Text File Splitter

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.05/5 (9 votes)

Mar 31, 2005

viewsIcon

70236

downloadIcon

2964

This simple project shows how to use the Stream Reader and Stream Writer to read and write files

Source Files: Download source code - 37.4 Kb

Screen Shot
Sample image


 

I was working on a much larger project when I realized I needed to make a huge text file smaller so I could load it into notepad easier, and still retain the the main format of the file.

I couldn't use a file splitter because it splits the file based on File size, and they tend to split the file in the middle of lines, and not at the end of the line.

So I went about writing a tiny application that will take a text file and split the file line by line until the number of lines in the new file is the size the user wants.

I have just made a slight modification 4/8/2005 that now allows the user to choose if they wish to split the file up by a certain number of lines or a cetain number of files. If the user chooses to split the file by a certain number of files the program will create the number of files with equal amouts of lines