Question: import CSV changes "1" to number.

I have plain text files with comma delimited fields. Some fileds are strings and some are numeric.

When importing the file using

data:=Import(file_name,format="CSV",output=Matrix);

Maple changes any field which is string but contains a number inside it, as in "1"  to number 

And this causes all sorts of problems for me when processing the matrix data, since the program expects some fields to be strings. 

I looked at all options, but do not see how to tell Maple to keep a string as string, even if what is inside it is a number.

Here is an example file  "t.txt"

1,2,"0",4
1,2,"1",4
1,2,"A",4

I read it as follows

restart;
file_name:="C:/TMP/t.txt";
data:=Import(file_name,format="CSV",output=Matrix);

And Maple returns 

You see it changed "0" to 0 and "1" to 1.

This might be how CSV is supposed to work?. Does Maple have any option to override this default behavior in order to keep strings as strings, even though there is a number inside the string. I'll try to see if there is another format other than CSV to try which might behave better.

Maple 2021 on windows 10.

Please Wait...