Re: I/O reading formated files



On Sun, 16 Jul 2006 23:02:56 -0700, Julian Bessenroth wrote
(in article <1153116176.186182.145750@xxxxxxxxxxxxxxxxxxxxxxxxxxx>):

Steven G. Kargl schrieb:

READ(2, *, IOSTAT=ios) a,b,c,d

Hmm, I'm a bit confused. What is al that formated reading for if the
best on its own what to do?

It works, but ....?

First, please note that you appear to have made a common terminology
error that leads to much confusion. List-directed I/O *IS* formatted.
If it weren't formatted, humans couldn't read it at all - it would be
in raw bits instead of characters. Yes, the terminology matters, as
people write programs that don't work because of this terminology
confusion (for example, they open a file as "unformatted" because they
intend to use list-directed I/O on it).

What you are asking about is the distinction between two kinds of
formatting - list-directed formatting and explicit formatting. But
anyway...

List directed input is simple, but is far from a universal panacea.
There are many circumstances in which list-directed input does the
wrong thing. A complete treatment of the question is far too long for
here. Thus, yes, the language needs something in addition to
list-directed input. Your particular data appears to well match what
list-directed input can handle and I think it probably the best
solution for your problem; it is certainly a simple one. But
list-directed can't handle everything - for one example, character data
is sometimes in forms that list-directed can't handle.

--
Richard Maine | Good judgment comes from
experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain

.



Relevant Pages

  • Re: Formatted output and new_line(a) on " " systems
    ... You are talking about list-directed formatting, ... This is the first I recall of someone refering to list directed files as "unformatted" but I can understand that confusion as well. ... Support the Original G95 Project: http://www.g95.org ... Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html ...
    (comp.lang.fortran)
  • Re: Formatting a print statement
    ... output is a formatted file and thus you can't do unformatted output to ... Many people incorrectly refer to list-directed formatting as ... possible that the above is a consequence of the confusion that often ...
    (comp.lang.fortran)
  • Re: Weird date formatting
    ... Christine wrote: ... different nationalities in the office where each person enters the date differently: ... To eliminate confusion, for example, I've formatted a ... The only time it works is if you actually enter the short-form month and year, which is kinda missing the point of formatting the cell to begin with. ...
    (microsoft.public.excel.newusers)
  • Re: Taking multiple prices then adding them together...
    ... All your changes seem to do is increase the potential for confusion. ... > namespace directive into function scope. ... I find the new formatting more confusing, ... and expect a newbie would as well (though it certainly depends on the ...
    (comp.lang.cpp)
  • Re: Record Problem
    ... This *IS* formatted output. ... You are referring to the difference between ... list-directed formatting and explicit formatting. ... Yes, the terminology does matter, because people quite often write code ...
    (comp.lang.fortran)