I have 60 files in text format. they are summary_1, summary_2, summary_3 and so on. first line of each file is "time dayof". I need to remove the "time dayof" line from each file. I am doing the following code but unable to open new files as I could not understand how to use the for loop here.
You need to construct a string that contains the name of the summary file for the current iteration of the loop. This string will need to be constructed as "summary_" followed by the current loop index, followed by the ".out" extension.
You can then use this filename to open the file, rather than just "summary.out" as you're doing now.
We are established psychics, but could you nevertheless humour us by telling the error message?
You say that you have data to process. This implies that you are not just learning to program, but actually need to do something "useful". The obvious question is then: Why C++? A one-liner shell script with common GNU programs accomplishes the "remove first line from file(s)" hands down.