Re: How to Read csv Files with both Characters and Numbers?
- From: relaxmike <michael.baudin@xxxxxxxxx>
- Date: Thu, 27 Mar 2008 06:18:03 -0700 (PDT)
Hi,
All the ideas here are interesting, but I would have chosen another
way. In other languages, one could use two string manipulations
tools which would make the current problem very simple to solve :
- 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...
With these basic tools, it would be easy to do an algorithm like
this (in pseudo-code):
foreach line
split the line at each ";" with string_split
foreach component
compute the class of the component with string_is
check that the current component has an acceptable value
process it
Of course, the basic blocks string_split and string_is do not
exist, therefore one would have to develop it...
Regards,
Michaël
.
- Follow-Ups:
- Re: How to Read csv Files with both Characters and Numbers?
- From: Richard Maine
- Re: How to Read csv Files with both Characters and Numbers?
- References:
- How to Read csv Files with both Characters and Numbers?
- From: qquito
- Re: How to Read csv Files with both Characters and Numbers?
- From: glen herrmannsfeldt
- Re: How to Read csv Files with both Characters and Numbers?
- From: Kurt Kallblad
- Re: How to Read csv Files with both Characters and Numbers?
- From: glen herrmannsfeldt
- Re: How to Read csv Files with both Characters and Numbers?
- From: qquito
- How to Read csv Files with both Characters and Numbers?
- Prev by Date: Re: what is wrong with this code?can someone walk me through this?
- Next by Date: Re: index function problem
- Previous by thread: Re: How to Read csv Files with both Characters and Numbers?
- Next by thread: Re: How to Read csv Files with both Characters and Numbers?
- Index(es):
Relevant Pages
|
|