# Reading formatted input in fortran

by agalya
 The E format allows the user to enter data stored in scientific notation. The syntax of the E format is the same as the F format: Ew.d Here W is the total width of the variable, including exponent, while D indicates the number of implied decimal places in the mantissa. The data field should contain the mantissa and the letter E followed by an integer indicating the power of ten to which the mantissa is to be raised. For example, E6.0 would read 1234E2' as 123400' (1234.0 x 10^2), while E6.1 would read 1234E2' as 12340' (123.4 x 10^2). As before, any decimal actually coded overrides the format specification, so that both E6.0 and E6.1 would read 123.4E2' as 12340'. "
 Mentor P: 11,782 If the data is separated by spaces as you have here, you can use the default format (*):  real a, b, c, d, e, f, g, h open (unit=10, file='agalya.txt') read (10, *) a, b, c, d, e, f, g, h write (*, *) a, b, c, d, e, f, g, h end This "write" statement doesn't give you the numbers in the same format in which you read them; it uses its own default format. You can of course specify your own output format as needed.