Sabtu, 11 Juni 2011

Re: [ExcelVBA] Re: CSV file inconsistency

 

> Excel is getting too smart for it's britches. (;-)

No, it's actually a bit dumb about CSV files:

- When it's writing them, it tries to avoid putting quotes around things,
even normal text strings. It only seems to put quotes in when the text
contains a comma or a double quote.

- When it's reading them, it seems to drop the quotes too early. For
instance, "12345678901234567890" gets its quotes removed and is then treated
as a number. Stupidly, if the string is '12345678901234567890 (i.e. a
leading single quote), then it comes in to Excel intact and even displays
the leading quote. :-(

Simply, Excel isn't good at CSV.

Regards, Dave S

----- Original Message -----
From: "noskosteve" <noskosteve@yahoo.com>
To: <ExcelVBA@yahoogroups.com>
Sent: Saturday, June 11, 2011 2:19 PM
Subject: [ExcelVBA] Re: CSV file inconsistency

>
> I just looked and no quotes. Excel is getting too smart for it's britches.
> (;-)
> I both formatted cells as text and tried putting the ' first with same
> result - no quotes. Just strings of digits in the CSV file (read in Note
> pad).
>
> Changing the format after re-opening the file restored the digits, but if
> there are decimals there could be a problem picking the format. But a
> macro could do the reformatting.
>
>
> Steve
>
> --- "David Smart" wrote:
>>
>> No, it's not a text field (in the CSV file), it's just a string of
>> digits.
>> A text field in a CSV file would presumably have quotes around it.
>>
>> Regards, Dave S
>>
>> >> Thomas wrote:
>> >> > I entered the numeric values into a new EXCEL and then save it as a
>> >> > CSV
>> >> > file. When I open the CSV file, the value in each column turn into
>> >> > some
>> >> > scientific number (Exponential number). It is not showing the same
>> >> > value I
>> >> > entered.
>> >> >
>> >> > Is there ways to prevent this from happening?
>> >> >
>> >> > Thanks for your response.
>> >> >
>> >> > Regards,
>> >> > Thomas
>
>
>
>
> ------------------------------------
>
> ----------------------------------
> Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go
> here: http://www.mousetrax.com/techtrax to enter the ezine, then search
> the ARCHIVES for EXCEL VBA.
>
> ----------------------------------
> Visit our ExcelVBA group home page for more info and support files:
> http://groups.yahoo.com/group/ExcelVBA
>
> ----------------------------------
> More free tutorials and resources available at:
> http://www.mousetrax.com
>
> ----------------------------------Yahoo! Groups Links
>
>
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1375 / Virus Database: 1513/3693 - Release Date: 06/10/11
>

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
MARKETPLACE

Get great advice about dogs and cats. Visit the Dog & Cat Answers Center.


Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar