Importing delimited text file - loading numeric as text

GDAS

New Member
Joined
Sep 18, 2006
Messages
2
I'm developing an extract from ERP system SAP, in the form of a csv file which can then be imported into Excel for manipulation. One of the fields in the csv file is made up of numeric characters, but sometimes has leading zeros which I want to keep when imported in Excel. However, when I open the csv file in Excel, a value such as 001 is treated as numeric and becomes 1. I have tried inserting a single quote in front in the csv file, i.e. '001 but then Excel treats the quote as part of the text field, unlike the situation where you type '001 directly into the worksheet.

Any ideas?

thanks,

Graham
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Try changing the file extension from csv to txt, then specifying Text as the format for that column at step 3 of the Text Import Wizard.
 

GDAS

New Member
Joined
Sep 18, 2006
Messages
2
thanks Andrew. Your proposal works perfectly. This was my first posting on Mr Excel, the site came highly recommended by a friend, and I can clearly see why!

Graham
 

Forum statistics

Threads
1,136,926
Messages
5,678,614
Members
419,776
Latest member
mikelowski

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