July 23rd, 2008, 07:54 PM
Join Date: Jul 2008
Time spent in forums: 8 m 35 sec
Reputation Power: 0
File handling using streams !!!
I have this program : which reads one by one line by line from a txt file and modifies a line at a position after the line whr "ths " occurs in the file to be modified. For each line it reads it modifies in the given file at that location and creates a file with rest of content same naming file as page1.txt , for 2nd line it reads and modifies in the given file at same location it creates a file wid same content naming page2.txt and it continues...... till all the lines of other file from which each line is read and modified in given file ends .
But my problem is i want this code to be modified such that at the same location in file to be modified i want to read first line from file and change as previosly done and then read one more line from another txt file and change one more line after the previously modified line. i.e same operation as this . but 2 lines i wanna modify one read from 1st file and 2nd from 2nd file ( in both same line numbered file ) and modify it after the line whr "ths" occurs .and the naming and all will continue.
Can someone help me in modifying this one or with a program to do this .. i did this in unix . I donno whether i can use some other framework to do this.. which would be helpful to me . !!
using namespace std;
int main(char argc, char * argv)
num=new char ;
sin << i;
cout<<"i: " <<val<<endl;
val1 = "page"+val+".txt";