[J3] [EXTERNAL] Re: Value separators
Clune, Thomas L. (GSFC-6101)
thomas.l.clune at nasa.gov
Thu Feb 2 13:30:07 UTC 2023
Not a high priority for me, but I would certainly endorse a format for CSV. I could also imagine that it could (slightly) simplify CSV output.
* Tom
From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of j3 <j3 at mailman.j3-fortran.org>
Reply-To: j3 <j3 at mailman.j3-fortran.org>
Date: Wednesday, February 1, 2023 at 10:14 PM
To: j3 <j3 at mailman.j3-fortran.org>
Cc: Malcolm Cohen <malcolm at nag-j.co.jp>
Subject: [EXTERNAL] Re: [J3] Value separators
Right, list-directed does not work for csv files unless the character strings are delimited (or there are no character strings with embedded value separators). Blank is not the only problem, semi-colon and slash are also problematic as they may appear in undelimited character strings.
Perhaps your spreadsheet program has an option to always delimit character values?
I would also think that in csv files, end of record is significant viz the end of that input, i.e. should be treated as slash.
This is looking less like a “we should have another changeable mode, one that only affects list-directed input”, and more like “we should have csv-format input”. Perhaps FMT=**, or FMT=’,’.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Van Snyder via J3
Sent: Thursday, February 2, 2023 10:24 AM
To: j3 <j3 at j3-fortran.org>
Cc: Van Snyder <van.snyder at sbcglobal.net>
Subject: [J3] Value separators
Subclause 13.10.2 lists value separators for list-directed input.
If you want to read CSV data exported by a spreadsheet, and a column has a blank in it, that blank is interpreted as a value separator in addition to the commas.
There doesn't appear to be a way to turn off blank being a value separator.
Is it possible to add a changeable mode (i.e., can be specified either in OPEN or READ or WRITE) to specify a set of value separators? Say SEP=<scalar-default-char-expr> but not being limited to some specific set of words as DELIM is? The characters are interpreted as a set, rather than the value being interpreted as a di (tri quad ...) graph separator.
If its specified, the separators in 13.10.2 are superceded by the characters in <scalar-default-char-expr> , except slash, which ought to be forbidden (or ignored) in the specification. If the character value that specifies the separators has length zero, that should be interpreted as "use the default separators specified in subclause 13.10.2" rather than "there are no value separators."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20230202/17e88d8b/attachment.htm>
More information about the J3
mailing list