FILE *File_Output; FILE *File_Input; NumRecords = 0; File_Input = fopen ("GMCN.001", "rt"); File_Output = fopen ("PPO.001", "at"); if((File_Input && File_Output) != NULL) { while (fscanf (File_Input, "%d %lf %lf %lf %lf %lf %lf %lf", &GPSWeek, &GPSSecond, &Latitude, &Longitude, &Altitude, &Pitch, &Roll, &Heading) == 8) { if (Longitude < 0) Longitude = - Longitude; fprintf (File_Output, "%.10f,%.10f,%.3f, %d %.4f %.4f %.4f %.4f\n", Latitude, Longitude, Altitude, GPSWeek, GPSSecond, Pitch, Roll, Heading); // "carry" field Latitude += 0.001; fprintf (File_Output, "%.10f,%.10f,%.3f, %d %.4f %.4f %.4f %.4f\n", Latitude, Longitude, Altitude, GPSWeek, GPSSecond, Pitch, Roll, Heading); // "carry" field NumRecords ++; } LLtoUTM(RefEllipsoid, Lat, Long, UTMNorthing, UTMEasting, UTMZone); } else perror("opening files:");