Question: ImportMatrix(file_to_read, source=csv): reads string as integer

I have a plain text file, with hundreds of lines. I read using the command

ImportMatrix(file_to_read, source=csv):

The files has mixed fields which are integers and strings. The problem happens when a string happeneds to be "0". Maple interprets this when reading as the integer zero and not as the string zero! So that when I print this field later on using printf("%s",field) I get an error. (since I know this field is string, the format for output is fixed in the code). 

I made a very small example to illustrate. One line with 4 fields. The 4ht field is string.

This specific field is always a string with alphanumeric content in the file. It has " " around it. But sometimes the content of the string happens to be the string "0".  Maple gets confused and reads "0" as integer 0.

Is there a way to tell Maple not to read this string as an integer using ImportMatrix?

Here is MWE to show the problem


restart;
currentdirName :="C:\\bug";
currentdir(currentdirName);
file_to_read := cat(currentdirName,"\\maple_input.txt");
data:=ImportMatrix(file_to_read, source=csv):

print(data);
whattype(data[1,1]);
whattype(data[1,4]);

printf("%d,%d,%d,%s",data[1,1],data[1,2],data[1,3],data[1,4]):

 

The input file maple_input.txt has this one line in it:

1,2,3,"0"

As you can see, the 4ht field is a string.  But Maple reads it as integer:

 

This is using Maple 2017.1 on windows. Also Attached the text file.

1,2,3,"0"

Download maple_input.txt

 

Please Wait...