The character count edit descriptor returns the remaining number of characters in the current input record.
The corresponding I/O list item must be of type integer or logical. For example, suppose the following statements are specified:
READ (4,1000) XRAY, KK, NCHRS, (ICHR(I), I=1,NCHRS)
1000 FORMAT (E15.7,I4,Q,(80A1))
Two fields are read into variables XRAY and KK. The number of characters remaining in the record is stored in NCHRS, and exactly that many characters are read into the array ICHR. (This instruction can fail if the record is longer than 80 characters.)
If you place the character count descriptor first in a format specification, you can determine the length of an input record.
On output, the character count edit descriptor causes the corresponding I/O list item to be skipped.