Hi, I have a text file with say 50000+ lines (CSV format) and I would like to split this into smaller files of 1000 records with the last file most likely having < 1000 lines. I know DOPUS has the SPLIT tool but that's only allowing you to split by a particular size and not lines.
Would you want to duplicate the first row (often a list of heading names) at the start of each file as well?
A quick example which would just copy all the lines from one file to another:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var inFile = fso.OpenTextFile(input_file_path);
var outFile = fso.CreateTextFile(output_file_path, true);
while (!inFile.AtEndOfStream)
{
outFile.WriteLine( inFile.ReadLine() );
}
inFile.Close();
outFile.Close();