Open .csv file drops leading zeros even with quote delimited?

cboshdave

Board Regular
Joined
Jan 12, 2011
Messages
68
First, I have read through the import postings. I know this has been discussed, but I cannot seem to find the specific answer to what I am looking for.
The question that I still have is if I create a .csv file programatically for a non-excel user and I save the values as:

"01234","Person1"
"12345","Person2"

When I open the .csv file with Excel, why would Excel drop the leading zeros? I thought that would make it clearer to excel to treat it differently?? My users have to open this file all the time. I need to make it easier to open and deal with rather than having an import every time. Additionally, I need to read the file back in with their changes. So, I don't want a bunch of extraneous data. There was one suggestion that I create the file like (I think):
"01234","Person1","""A1"""
"12345","Person2","""A2"""
and that would preserve the leading 0. But I don't really want to handle the quotes when I read the file back in (extraneous data).

I know I am being picky, but there has to be a way around this that is not such a pain! I am trying to keep this process simple for my users and I am stumped.

Thanks,
Dave
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
it wont when opened in notepad,or another text editor its just that you have excel set to open csv,and excel does what it wants to do
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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