#include #include #include #include using namespace std; int main() { string line; int i; string input_file_name = "cwmystwythdata.txt"; ifstream input_file(input_file_name); if ( !( input_file.good() ) ) { cout << " File not found " << endl; cout << " Program terminates" << endl; exit(1); } string output_file_name = "1961.txt"; ofstream output_file(output_file_name); cout << " Skip header and first 2 years" << endl; for (i=1;i<32;i++) { getline(input_file,line); cout << line << endl; } // Now read the data for 1961 and write to a file for (i=1;i<13;i++) { getline(input_file,line); output_file << line << endl; } return(0); }