CSV-Retain Leading Zeros

  • Thread starter Thread starter GG
  • Start date Start date
G

GG

How can I retain leading zeros in a spreadsheet saved
as .csv
I remember being able to do it in the past...seems like
the newer version of excel doesn't allow it.
 
As a CSV file you probably can't. Even if you make the column Text, on import Excel will
reinterpret as a number and discard leading 0's. The solutions are to (1) save as a Text file
(extension .txt) and use the Import Text Wizard to specify the column as text, or (2) reformat
the column after importing the CSV.
 
I think you lose the leading zeroes when you re-import the file into excel.

Open up a fresh .csv file in Notepad and check it out.

If you have to retain the leading 0's in excel, you could rename the *.csv to
*.txt and get the text import wizard to pop up.

You can specify that field as Text.

(or you could import the file as *.csv and just format the column to show the
leading 0's.)
 
This issue is from getting data in spreadsheet form, then
saving as CSV and FTPing to our UNIX system to load into
Oracle tables.
I typically define my input data as comma delimited and
so CSV used to be fine for this.
Perhaps I need to change my load scripts to recognize tab
rather than comma....dagnabit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top