08-23-2010 05:40 PM
Hi,
I am using the excel get data toolkit to get string. It is reading in a for loop for a row by row read. It is reading a string fine, but when the element is TRUE, the output is 0 in string. When the element is FALSE, the output is -1 in string. Why is that? Why aren't I reading TRUE and FALSE instead.
Yik
08-23-2010 08:36 PM
Because True and False in Excel cells aren't strings, they are special boolean datatypes. If you happened to type in "true" (without the quotes) into a cell, you'll see it automatically changes to "TRUE". Just like typing in "8/23" it will jump to "23-Aug" which is the default date/time format for Excel.
(Actually, I've always found the 23-Aug format very annoying and would prefer it gave me 8/23/10. Does anyone know how to have Excel automatically format the date that way so that I don't have to go back and change the date format of the cell?)
08-24-2010 08:44 AM
Hi,
Thanks for the info. How do I make it a non boolean string if I really need to use the word true and false?
Yik
08-24-2010 10:09 AM
There are two options:
1. As Ravens Fan mentioned, you can put quotes around your TRUE and FALSE strings in Excel directly. This will likely be really tedious.
OR
2. Since you're reading line by line, you can check for a 0 or -1 are replace it with the TRUE and FALSE strings, respectively. This just requires a case structure after the read.