I am back, got my last program to run properly and I thank this forum for helping.
I am working on an assignment so I can use to study for my midterm tonight but can't seem to properly outfile data.

I've came across similar problems online but can't seem to understand out to set my accumulator so my total, max, min, avg can be set for each of the lines and then outfiled.

I tried running this code but it froze my computer when opening the outfile on my desktop so please do not try it, I dont want anyones computer to freeze.

My assignment:
A file contains 7 numbers per line and contains several records. Write a program to input each of the numbers, find the highest number, the lowest number, their total and average. Output the numbers, the highest, lowest, total and average for each set of 7 numbers to another file.A file contains 7 numbers per line and contains several records. Write a program to input each of the numbers, find the highest number, the lowest number, their total and average. Output the numbers, the highest, lowest, total and average for each set of 7 numbers to another file.
Data File
346 130 982 90 656 117 595
415 948 12 64 558 571 87
42 360 412 721 463 47 119
441 190 985 214 509 2 571
77 81 681 651 995 93 74
310 9 995 561 92 14 288
466 664 892 8 766 34 639
151 64 98 813 67 834 369


Here is my code, please tell me what i am doing wrong:

Code:
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;


int main()
{
    int   num, max=0, min=0, total, row=0;
    float avg=0;
    total=0;
    ifstream infile;
    ofstream outfile;
    infile.open("//Users//Eddie//Desktop//TestData.txt");
    if(!infile)
    {
        cout << "File could not be openned, terminating program." << endl;
        exit(1);
    }
    outfile.open("//Users//Eddie//Desktop//TestDataOut.txt");
    if(!outfile)
    {
        cout << "Output file could not be openned, terminating program." << endl;
        exit(1);
    }
    while(!infile.eof())
    {
        infile >> num;
        total=num;
        for(row=1; row<=7, row++; )
        {
        for(total=0, total<=7; total++;)
        {
            do
            {
                infile >>num;
                total=num+1;
                if(num>total)
                {
                    max=num;
                }
                if(num<total)
                {
                    min=num;
                }
                while(total=7)
                {
                    avg=total/7;
                }
                total=0;
                num=0;
                max=0;
                min=0;
                avg=0;
            }
            while(row<=7);
            outfile << "The greatest value is: " << max << endl;
            outfile << "The least value is:" << min << endl;
            outfile << "The total is: " << total << endl;
            outfile << "The average of the values is: " << avg << endl;
        }
        }
    }
    
    infile.close();
    outfile.close();
}