Please share your thoughts and ideas!!!
I have thousands of ASCII text files which I have to parse and get bits out of them all
(e.g.from 1st bit to 888th bit).Anyway of dealing such lot files to analysis ???
void main(int argc, char* argv[]){
char * buffer;
int index;
for(int ind=1; ind<argc; ind++){
ifstream is (argv[ind] );
is.seekg (0, ios::beg);
buffer = new char [100];
is.read (buffer,100);
switch(ind){
case 1:
show(buffer,100);
delete[] buffer;
break;
case 2:
show1(buffer,100);
delete[] buffer;
break;
........................................
........................................
........................................
case 1000
show999(buffer,100);
delete[] buffer;
break;
}
}
void show(){
Turning characters into bits of 1st file and push_back into a vector.
}
.......
.......
void show999(){
Turning characters into bits of 999st file and push_back into a new vector.
}
I used above to push bits of each file into a vector, but it requires thousands of vectors to be defined.
I had to make thousands line to code,which was bad coding.
providing any hint of reading and dealing with such a big number of files will be very helpful. Please shed some lights on it!!
Please be advised this is NOT homework or any project.
Thanks in advance for your attention.

New Topic/Question
Reply



MultiQuote






|