Frustrating CSV Conversion Issue

CPGDeveloper

Board Regular
Joined
Oct 8, 2008
Messages
190
Hi All,

I'm working on a script to export a query to a csv file. I'm having a very frustrating issue as certain numbers are being converted to scientific notation, despite initially setting the field to text in excel.

I am first exporting this query to excel, setting the column in question to text, and then saving it as a csv. When trying to open the csv, I get a conversion warning -- I select 'Don't Convert', and yet, some values are still converted. In the same column, some numbers are converted and some are not. It makes no sense to me.

All the values are entirely numeric -- oddly the values that are getting converted are 12 digits long, while the values that are not getting converted are 16 digits long. Image attached.

Any advice would be much appreciated.
 

Attachments

  • stupidcsv.PNG
    stupidcsv.PNG
    4.3 KB · Views: 14

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I am first exporting this query to excel, setting the column in question to text, and then saving it as a csv. When trying to open the csv, I get a conversion warning -- I select 'Don't Convert', and yet, some values are still converted. In the same column, some numbers are converted and some are not. It makes no sense to me.
Where exactly are you trying to open this CSV file?

If you TRULY want to see what the values in a CSV or any Text file look like, do NOT use Excel to view them! Excel will automatically perform its own conversions on them.
Try viewing the created CSV file in a text editor like NotePad to see how the values are TRULY stored in the CSV file.
 
Upvote 1
Solution

Forum statistics

Threads
1,224,808
Messages
6,181,073
Members
453,020
Latest member
mattg2448

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top