MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Import CSV can not understand string correctly

On 9/24/13 at 4:16 AM, itais at (Itai Seggev) wrote:

>On Sat, Sep 21, 2013 at 04:36:10AM -0400, Joug Raw wrote:

>>In my CSV file, I have string fields like 3D22 or so. While I
>>imported the CSV file in mathemtaica, the 3D22 string was converted
>>to number 3x10^22.

>>How dose this happened??? How can I avoid this kind of
>>transformation and keep my original string when Import a CSV file?

>You can set the option "Numeric"->False which will keep everything
>as strings.  Numbers will need to be explicitly converter to them,

Wouldn't this be equivalent to:

StringSplit[ReadList[filename.csv, String],","]

And given what Import needs to do to decide how to parse a file,
wouldn't using StringSplit with ReadList be more efficient? Or
perhaps the option "Numeric"->False effectively eliminates
enough processing of the file by Import there is no significant difference?

  • Prev by Date: Re: Quantity
  • Next by Date: Re: Quantity
  • Previous by thread: Re: Import CSV can not understand string correctly
  • Next by thread: Re: DDFLink