Efficiency is my problem here.
I have a text file(10mb) that at (535,2) (on each line) it has a two digit code for the month. I need to make a separate file to break each month into its own file not all rows will probably be in the same file but could. Before the while loop I defined ofstream date01-date12. Exactly like this:
With this code the files are made only when the if statement is satisfied but nothing is written to them. While testing I have defined each month with its own file before the while but then I open 12 months when only three might be needed.
while ( getline(source2,s2Line) )
if ("01" ==s2Line.substr(535,2))
if ("02" ==s2Line.substr(535,2))
Any suggestion? If I was unclear let me know.