• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Unusual format for .csv - =T("")

polarisking

Member
A co-worker recently received a .csv file where each field was delimited by

=T("Field Value")

So you ended up with
=T("Field Value"), =T("Field Value"),=T("Field Value"), etc.

Excel appears to recognize this and parses it appropriately. Can anyone shed any light on this syntax?
 
Polarisking

I have never seen this !

I think it is a very clever way to bring into Excel a Field Name when you import a table of numbers, with Field Names in the first row

I suspect that by using this, it tricks Excel into not identifying the Numbers in records 2..EOF as text which sometimes happens on import. I assume that this works as Excel probably checks the first row and then bases future values in the fields on the data type from the first record.

I am assuming all this as it is just as simple to use the field names as the first record

You must be careful that you don't have spaces in your record like you have above and below
=T("Field Value"), =T("Field Value"),=T("Field Value")
Note the spaces after the first ,

As the second Field will come in as text =T("Field Value") rather than the text value Field Value

My comments above are purely speculative, but the trick works so I am assuming I am close to the logic.
 
I like where you're going with the inference.

It gets more bizarre - the vast majority of fields have the =T construct, but many do not. That's where Excel chokes and begins guessing when to ignore the =T values and when not to - it fails occasionally.
 
Some of the text strings have an embedded LF (char(10)) embedded. That's appears to where it's breaking. No instances of blanks between the , and the = that I can see.

Thanks for discussing this with me.
 
Back
Top