Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15533 > unrolled thread

Re: Import CSV can not understand string correctly

Started byBill Rowe <readnews@sbcglobal.net>
First post2013-09-25 06:26 +0000
Last post2013-09-25 06:26 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Import CSV can not understand string correctly Bill Rowe <readnews@sbcglobal.net> - 2013-09-25 06:26 +0000

#15533 — Re: Import CSV can not understand string correctly

FromBill Rowe <readnews@sbcglobal.net>
Date2013-09-25 06:26 +0000
SubjectRe: Import CSV can not understand string correctly
Message-ID<l1tvm8$3b6$1@smc.vnet.net>
On 9/24/13 at 4:16 AM, itais@wolfram.com (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,
>though.

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?

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web