Link to home
Start Free TrialLog in
Avatar of gringlobal
gringlobal

asked on

Prevent reformatting of data in CSV import in Excel

How to force excel to treat columns as text automatically. I have a .csv file as below

acp,acno,ivs,ivt
"PI",500000,"01","SD"

The third column always has the leading 0 stripped. I know I can change it to a .txt file name and use the import wizard dialogue to manually treat the column as text. But I really prefer it to be automatic and not force the user to constantly manually set column types. Is there a way to force the column to automatically be text? I thought I had read something about apostrophe at the start of the column but that doesn't seem to work, the apostrophe stays in the column in Excel.
ASKER CERTIFIED SOLUTION
Avatar of mark_harris231
mark_harris231
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steven Carnahan
Do you have the ability to control the content of the .csv file?  If so, can you try making the third column a formula?

i.e.:   ="001"  The = needs to outside the quotes.
oops - I started my reply and got interrupted.  Mark gave the proper response.   :)
Avatar of gringlobal
gringlobal

ASKER

I have control of the format and the = seems to work. You see ="01" when you select the cell but it looks OK in the cell and filter seems to work. Thanks.
Glad to be of help...