Re: How to read a csv file when the date comes with /?



On 29 jun, 12:34, nos...@xxxxxxxxxxxxx (Richard Maine) wrote:
Ed <emammen...@xxxxxxxxx> wrote:
Never mind!  I've got it.

i=2;read(unit=line(spos(i-1)+1:spos(i)-1) ,fmt='(A)')dh
i=3;read(unit=line(spos(i-1)+1:spos(i)-1) ,fmt='(A)')dhb

While that should work, it is more complicated than you ned. Internal
reads are mostly for converting data from string to numeric form, using
the conversion facilities already built into the compiler's format
processing. When you use an internal read with an 'A' format, you aren't
really doing any conversion, so the internal read is unnecessary. You
could just do

  i=2; dh  = line(spos(i-1)+1:spos(i)-1)
  i=3; dhb = line(spos(i-1)+1:spos(i)-1)

--
Richard Maine                    | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle           |  -- Mark Twain

Many thanks. It works just fine and I don't need to write an extra
code for nothing.

Ed
.



Relevant Pages

  • Proposal: String::Format::General
    ... It provides format string parsing and output assembly, you provide the code that implements the individual conversion characters. ... Format syntax is kind of a cross between sprintf and strftime, but how close it is to each of these depends on the semantics implemented by the user. ... Note that the following is pre-alpha documentation; the interface to the output conversion code has changed since yesterday, ... conversion character, and contain a number of optional fields which may ...
    (comp.lang.perl.modules)
  • Proposal: String::Format::General
    ... This should be considered pre-Alpha, since it has changed since yesterday, and I am seriously considering passing the format parameters to the output conversion code as a hash reference instead of a large number of arguments. ... Some limited heading capability is provided. ... This module provides a formatter class which allows its user to ...
    (comp.lang.perl.modules)
  • Proposal: String::Format::General
    ... It's almost a meta-formatter with the user providing individual conversion code behind a sprintf/strftime-like interface. ... A format is basically a string into which data are to be inserted. ... conversion character, and contain a number of optional fields which may ...
    (comp.lang.perl.modules)
  • Re: Proposal: String::Format::General
    ... It's almost a meta-formatter with the user providing individual conversion code behind a sprintf/strftime-like interface. ... A format is basically a string into which data are to be inserted. ... conversion character, and contain a number of optional fields which may ...
    (comp.lang.perl.modules)
  • Re: Oodles of receivers
    ... but perhaps our recent complete conversion from standard to HDTV might ... After I got the monitor we decided to make a complete conversion to ... The screen format issue. ... The PBS station seems to be the best at HD broadcasts. ...
    (alt.tv.tech.hdtv)