Frustrating CSV Conversion Issue

CPGDeveloper

Board Regular
Joined
Oct 8, 2008
Messages
185
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: 10

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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