Programme for a gps/sd card/sensors - compilation problems (for a novice)

Hi,
I am trying to sort out a compilation programme for a gps/sd card/sensors using a cut-n-paste technique. I know that I know very little about programming, but have managed to make some progress. I seem to be hung up on getting the gps data to print to the sd card. With my negligible experience, I can vaguely see that I need to pick up some term from the 'setup' section and include this in the loop section as a write statement, but I can't see what this might be. Please excuse my abyssal ignorance on the matter. Even a general pointer would be immensely

The serial monitor prints the following (the programme itself is attached):

"Initializing Card
Card Ready
Reading Command File
Refresh Rate = 99611.98ms
ID,Light, Temp, IR1, IR2 // this data prints to the sd card

$GPGGA,114530.00,5454.19890,N,00148.67415,W,1,06,1.45,85.7,M,48.3,M,,*7A
$GPGGA,114531.00,5454.19923,N,00148.67423,W,1,06,1.45,85.5,M,48.3,M,,*75
$GPGGA,114532.00,5454.19912,N,00148.67432,W,1,06,1.45,85.3,M,48.3,M,,*72"

Many thanks for reading this, thus far.

Colin

gps_sd_sensors.ino (5.86 KB)

{
    
}

Useful.

void loop()

{
  while(1)
  {
    if(GPS.available())
    {
      // THIS IS THE MAIN LOOP JUST READS IN FROM THE GPS SERIAL AND ECHOS OUT TO THE ARDUINO SERIAL.
      Serial.write(GPS.read()); 
    }
 
  }
}

Where is there any code to open a file? To write data to that file? To close that file?

Thank you very much, Paul.

I am thinking about your comments! They will help me work my way through the problem and learn, which is good.

Again, thank you.

Colin.