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



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
.



Relevant Pages

  • Re: WBEM time in VB.NET WQL SelectQuery
    ... Well, I do string manipulations now, but it is very strange, that this functionality is present in VBScript, and it's absent in .NET... ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Can Turing machines do arithmetic?
    ... >>algebra as string manipulations, so don't see where the distinction ... > was an abstraction. ... > binary digits representing n. ...
    (comp.programming)
  • Re: Strings as value objects
    ... language because then not everybody has to invent the wheel again. ... string manipulations are ubiquituous and often ... So a sound std lib better provide means ...
    (comp.object)
  • Re: Strings as value objects
    ... > I don't regard the availability of both variants a premature optimization. ... string manipulations are ubiquituous and often ... So a sound std lib better provide means ...
    (comp.object)
  • Re: Java String to date format
    ... are there any methods/properties ... >> The original String can be null as well. ... > string manipulations, but they are simple. ... > John O'Conner ...
    (comp.lang.java.programmer)