Fortran I have a .dat file that I am trying to extract the information from in order to calculate the average miles per gallon and the sigma of the distribution.
The file has lines with the structure
19990122 88888 30.5
The first word is a date in yyyymmdd format, second word is odometer reading, third word is amount of fuel used to fill the tank.
I know that I need to take the mileage from a subsequent line, subtract the mileage from the preceding line and then divide that answer by the amount of fuel to get the mpg but I am unsure how to do this. Any suggestions would be appreciated.
so far-
Program mpg
Integer i,j,k
open (unit = 1, file = "car.dat" )
The file has lines with the structure
19990122 88888 30.5
The first word is a date in yyyymmdd format, second word is odometer reading, third word is amount of fuel used to fill the tank.
I know that I need to take the mileage from a subsequent line, subtract the mileage from the preceding line and then divide that answer by the amount of fuel to get the mpg but I am unsure how to do this. Any suggestions would be appreciated.
so far-
Program mpg
Integer i,j,k
open (unit = 1, file = "car.dat" )