Hi,
I have a script to abstract a .txt files end with (*.dly).
My problem is, I had to repeat the task by changing the file name manually. I need to abstract 100 files in a folder. Can somebody show me how to change my script so it can read multiple files in a folder. The files will end with .dly (which is readable in txt). The program will write it to .txt files after abstract some data from that files.
Below is my script:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string number,number2;
ifstream input;
ofstream output;
input.open ("aaxzi_temp_2000.dly");
output.open ("aaxzi_temp_2000.txt");
for (int j=1;j<=360;j++)
{
for (int k=1;k<=1;k++)
{
do
{
number2 = number;
input >> number;
} while (number != "9999.99" || number2 != "is");
//Which number
for (int i=0;i<2505;i++)
input >> number;
output << number << " ";
}
output << endl;
}
system ("pause");
return 0;
}
This is my script for 1 file. I need to abstract hundreds of files in a folder. I hope somebody can help me, please... as I totally new to programming script.
Thank you for your time.... Cheers....