Instead of output.open(outputname ".txt") should be output.open(outputname + ".txt");
(end your statement with ;, correct also line 33).
= is an assignment operator. For comparison use string.compare() or ==,
Instead of if(line= "SOURCE=") maybe if(line == "SOURCE=") is more appropriate.
thanks for the string compare pointer. It got me on the right track with str.find(str2). I have so far managed to ge the programm to produce the correct files but I have a porblem with the data output. I have only managed via a counter of the amount of line to copy the entire file but I have been unable to only get the numbers in between DATA and END written into the file.
I think the correct condition would be a
if{string data is found}
do{
input ->output
}while(string does not equal END)
The above gives an endless loop which just writes into the same output file over and over. Is there a way to give the break command a trigger in the form of a string being read in?