Opening txt file in Excell - leading zeros needed

rdriver

New Member
Joined
Dec 10, 2004
Messages
6
I need to open a .txt file with Excel. When I open the file, leading zeros are stripped.

It is OK if the data is converted to text in the process.
I can modify the program that generates the txt file to include an apostrophe in front of the number but then it imports and shows the apostrophe. I don't want the apostrophe to show.

Am I on the right track? Any suggestions?

Thanks
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

rdriver

New Member
Joined
Dec 10, 2004
Messages
6
I think I found the answer to my question, I put ="00987" with the equals sign and quotes and it looks like it works.

It looks like this board is extremely busy, many thanks to you guys that spend your time helping others.
 

rdriver

New Member
Joined
Dec 10, 2004
Messages
6
I am helping our programmer, he creates the txt file for the user who then opens it by right clicking on the file name and then selecting open with Excel.
 

just_jon

Legend
Joined
Sep 3, 2002
Messages
10,473

ADVERTISEMENT

So you do get a series of menus pop up?

If so, on the Text Import Wizard - step 3 of 3 menu, make sure to make the column hoding those leading zeros of type Text.
 

rdriver

New Member
Joined
Dec 10, 2004
Messages
6
You know what is weird, I thought you would get an import wizard of some type but since it is saved as a tab delimited file (with a .txt extension) it just opens in Excel without the import wizard.
 

pchelpsource

New Member
Joined
Nov 11, 2003
Messages
17
in order to get the wizard, you need to open the .txt file through the excel open menu, not by right clicking the file in windows explorer.
 

Forum statistics

Threads
1,147,681
Messages
5,742,597
Members
423,740
Latest member
JCF_

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
Top