Re: How to Read csv Files with both Characters and Numbers?



relaxmike <michael.baudin@xxxxxxxxx> wrote:

- string_split(string,chars,nbcomponent,component) splits
the given string everytime one character in the chars argument is
found and add it to the array of string "component".

- string_is(string,class) returns false or true if the
given string is an element of the given class, with class
is a string chosen in the list : "integer", "character", string",
"real", "double", etc...
....
Of course, the basic blocks string_split and string_is do not
exist, therefore one would have to develop it...

....which isn't to hard to do. I've done simillar string utility routines
myself and I use them all the time. The interface to my procedures isn't
exactly as above, but they do follow the basic idea of having string
utility procedures that get used for parsing tasks.

I think that most people who have done much string manipulation in
Fortran have eventually developed such a set of personal string
manipulation tools (or borowed one from someone else). It's just the
"obvious" thing to do once one notices that the same basic tasks keep
coming up. That old "code reuse" buzz phrase; us old Fortraners have
been reusing code from long before the term was popularized.

But then, at a lower level, the procedures use some of the kinds of
techniques discussed here. They just add a slightly higher level of
interface.

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



Relevant Pages

  • Re: Variable length/precision formats?
    ... "&" is contunuation in Fortran anyway. ... purpose of string substitution. ... Something more general purpose, although for general purpose use, I'd prefer it also support substitution of character strings (, not that it makes any sense for the numerical portion of a format, but you could use it to change from say I format to Z format (and in a wide variety of other places as well). ...
    (comp.lang.fortran)
  • Re: ATTRIBUTES problem
    ... personally use Compaq Fortran and Microsoft C++. ... The string length is a big issue. ... and the Fortran code may well not do what you ... > fortran compiler for windows I'm trying to get acquainted with how strings ...
    (comp.lang.fortran)
  • Re: Launching Another Executable from my Program (Borland C++)
    ... command line args) from a DOS C++ app? ... supplied with MS Fortran F77 and C compilers. ... c The systemfunction passes the given C string (00hex ... c form of spawn is executed as follows: ...
    (comp.os.msdos.programmer)
  • Re: Fortran-compiled DLLs in Python
    ... WindowsError: exception: access violation ... > I do not know how fortran passes this parameter, ... strings may pass a "string descriptor", ...
    (comp.lang.python)
  • Re: ATTRIBUTES problem
    ... >!dec$ attributes reference:: mystring ... but there are A LOT of issues with mixing Fortran and> C/C++ ... > The string length is a big issue. ... > subroutine test ...
    (comp.lang.fortran)