Help Scanning document

For an assignment I have to create a program that reads two files. One (Student data file) containing multiple students' ID #s, semesters courses was taken, course names, course #s, the letter grade students received and the equivalent number grade. The other file (Courses info) includes the course names, course numbers, contact hours, and designated code. The professor wants us to create two separate files: one with all of the information in the Student Data file plus the contact hours and designated code for the matching courses. We can't use getline. I'm doing the first part and it's not working. Plus, I have no idea how to start the second part.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
  #include <iostream>
#include <fstream>

using namespace std;

int main()
{
   ifstream fin;
   fin.open("StudentData.tsv");      //opens SD dile
   string emplID, SemC, SubCod, CataCod, LetGrad, NumGrad;

   ifstream fin2;
   fin2.open("HunterCourses.tsv");   //opens HC file
   string Subj, Cata, Con_Hrs, DesCod;
   
   ofstream fout;
   fout.open ("StudentDataPlus.tsv");  //creates && opens SDP file
    
    
    for (int i = 1; i <=6378 ; i++)
    {
        for (int j = 1; j <= 13875; j++)
        {
           fin >> emplID >> SemC >> SubCod >> CataCod >> LetGrad >> NumGrad;
           fout << emplID << " ";
           fout << SemC << " ";
           fout << SubCod << " ";
           fout << CataCod << " ";
           fout << LetGrad << " ";
           fout << NumGrad << " ";
        
        
    
        fin2 >> Subj >> Cata >> Con_Hrs >> DesCod;
        fin2.clear();
        fin2.seekg(ios::beg);
        bool found = false;
            
            if (SubCod==Subj && CataCod==Cata)
            {
                fout << Con_Hrs << " ";
                fout << DesCod << endl;
            
                found = true;
                break;
            }
            if (!found)
            {
                fout << "3.00 RNL" << endl;
            }
        }  
    }

   fin.close();
   fin2.close();
   fout.close ();
    
   return 0;
}
Topic archived. No new replies allowed.