|
发表于 2014-3-16 09:15:23
|
显示全部楼层
vaneagle wrote:[quote]Alan Kirk wrote:A text file is, by definition, text. There aren't strings and "values", just text characters which any program which reads the file can interpret as values or strings for internal storage.
I presume you mean that you don't want quote marks around the values that are output. In that case, you just set this in the Prolog:
Code: DatasourceASCIIQuoteCharacter='';
That is, set the quote character to an empty string. Note that that will remove all quote marks around the output fields, so if you still need them for text output fields you need to add them to that output explicitly.
Yes, i opened the file via excel and hence no quote marks so i thought all was good with the world!. But opening in notepad shows a different story
[/quote]
Yup, Excel "helps" you by converting any values in a text or .csv file into what it thinks is the right format; essentially what I was saying about the program that opens the file interpreting "as values or strings for internal storage". When Excel sees something that is entirely numeric but for the presence of surrounding quote marks, it interprets it as a number and writes it into the cell accordingly. If the field has even the vaguest resemblance to a date, it'll change it into that. This is sometimes (often) a pain in the backside because it can result in dropped leading zeroes of account codes, for instance, or accounting combination codes being converted into scientific notation values. That's why if I need to load something into Excel I ensure that it has a .cma extension rather than a .csv one; .csvs it loads automatically by default, .cmas it doesn't know what to do with so it kicks off the text import wizard, giving you full control on a field by field basis. But even then if you ask for the field to be imported as a value, the surrounding quote marks will be stripped.
vaneagle wrote:I thought there was something i was missing. That's it! Thanks heaps for that! Exactly what i was after.
You're welcome. |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|