reading csv and precision

MetLife

Board Regular
Joined
Jul 2, 2012
Messages
241
Hi,

I have a .csv file and it is filled with numbers between 0 and 1. There are about 15 significant digits in the file.

The issue seems to be that when I save the file (copy the values to excel then save as .csv) the .csv is truncating the digits to 10 places.

Is there anyway to keep the total number of digits? I noticed this when I tried reading the file with vba and the results were slightly off.

Thanks
 
Last edited:

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,342
Change the number to text before saving maybe, ie insert a text character.
In your VBA remove the text character of course after reading each line.

Or change the format of the cell to text.
 
Last edited:

MetLife

Board Regular
Joined
Jul 2, 2012
Messages
241
OK thanks! It seems changing to text works.

I am using .csv files because these are universal files that are read by different software like C++ and not all can as easily read an excel file.

So since text files are more "universal", we try to use them for comparability.
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,099,788
Messages
5,470,786
Members
406,721
Latest member
Laiceyshae

This Week's Hot Topics

Top