Next: About this document ...
Up: File I/O
Previous: Details

Checkoff

Write a program that reads a file containing five lines, each formatted as (I4I4). That is, the first four columns of each line contain an integer, as do the next four columns. So in all, there will be ten numbers in the file.

Your program should read the numbers from the file, and write them out to a different file, formatted as (I4). That is, each line contains a four-digit number.

For example, if your input file contains

 111 222
 333 444
 555 666
 777 888
 999   0

Your program should write the output file to contain

 111
 222
 333
 444
 555
 666
 777
 888
 999
   0

Note: Be sure to put a newline into the file at the end of the last line of data, or Fortran will think that the file has ended prematurely.

Be sure to get a working program---you'll need it to check off the next lesson.

Homework

There is no homework with this lesson.


Next: About this document ...
Up: File I/O
Previous: Details

Hamlet Project
hamlet@cs.utah.edu