Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (54 sloc) 2.07 KB

The 'fmt=' specifier in a read or write statement can give either the line number of a format statement, an actual format string, or a * for free format.


A format specifier is a parenthesized string of format descriptors.

	<td><em>n</em> positions of integer data</td>

	<td><em>n</em> positions of real data (with d decimal places) &mdash; Decimal point form</td>

	<td><em>n</em> positions of real data (with d decimal places) &mdash; Exponent form</td>

	<td><em>n</em> positions of logical data</td>

	<td>[<em>n</em> positions of] character data</td>

	<td>skip <em>n</em> horizontal positions (X spaces)</td>

	<td>skip line</td>

	<td>tab to column number <em>c</em></td>
Descriptor Meaning

Descriptors, or groups of descriptors, can be repeated by prefixing, or parenthesizing and prefixing, with the number of repeats. For example I4 can be repeated as 2I4 and I4,1X as 2(I4,1X).

Plain text strings can be inserted in the format string using double quotes (or two single quotes).

When the variable cannot be printed entirely given the format specified, it is displayed as placeholders ('*' usually)


NB: ␣ is a space

write(*,'(i6,i2)') 3, 2


write(*,'(f10.4,e15.7)') 12.7864, 234.4591


write(*,'(2x,"record Nº",i2," is ",A6)') 10, 'Philip'


write(*,'(2X,2(I4,1X),''name '',A4,F13.5,1X,E13.5)') 77778, 3, 'ABCDEFGHI', 14.45, 15.5666666