How to keep leading zeros when opening a csv file

%3CLINGO-SUB%20id%3D%22lingo-sub-2020794%22%20slang%3D%22en-US%22%3EHow%20to%20keep%20leading%20zeros%20when%20opening%20a%20csv%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2020794%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20prevent%20Excel%20automatically%20removing%20leading%20zeros%20when%20opening%20a%20file%20originally%20in%20csv%20format%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2020794%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2020826%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20keep%20leading%20zeros%20when%20opening%20a%20csv%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2020826%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F913672%22%20target%3D%22_blank%22%3E%40PaulHL1820%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EChange%20the%20extension%20from%20.csv%20to%20.txt.%3C%2FP%3E%0A%3CP%3EOpening%20the%20.txt%20file%20will%20start%20the%20Text%20Import%20Wizard.%3C%2FP%3E%0A%3CP%3EIn%20Step%203%20of%20this%20wizard%2C%20you%20can%20specify%20the%20data%20type%20of%20each%20column.%20Select%20Text%20for%20the%20columns%20in%20which%20you%20want%20to%20preserve%20leading%20zeros.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Is there a way to prevent Excel automatically removing leading zeros when opening a file originally in csv format?

2 Replies

@PaulHL1820 

Change the extension from .csv to .txt.

Opening the .txt file will start the Text Import Wizard.

In Step 3 of this wizard, you can specify the data type of each column. Select Text for the columns in which you want to preserve leading zeros.