programm which will be processing a file based on a number of lines


Hi all

I would like to ask you to help me with a
programm which will be processing a file based on a number of lines
ex: To receive file in parameter of 1 Million lines
and process it in different files for example each file
4 thousand line

Thanks for help.

If I understood you correctly:

Open the first file for reading.
While the first file is ifstream::good(), do the following:
{
Create a new file for writing (named appropriately for your sequence of new files).
Use a loop from 0 to 4000 (or whatever you like) to read a line from the first file and write it to the new file.
Close the new file.
}
Close the first file.

Hope this helps.
Topic archived. No new replies allowed.