Solved

want leading  0's in a csv file not xls

Posted on 2013-10-27
5
278 Views
Last Modified: 2013-10-27
want all the fields in a column to be 9 digits

some numbers are
67
want

00000000000067

tried column change in microsoft excel 2007

but will not save because I need to convert to .csv
0
Comment
Question by:rgb192
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 500 total points
ID: 39604336
[EDIT]: You have now changed the question! [/EDIT]

Hi,

Select the entire column, & use [CTRL]+[1] key combination to display the "Format Cells" dialog box.

Click the [Number] tab if not already shown, & select the "Custom" Category.

For 9 digits, enter a Type of:
000000000

Confirm with the [OK] button.

PS. I note that your question asks for "9 digits" but you then state:
00000000000067

(14 digits)

If you do want 14 digits, enter a Type of:
00000000000000

BFN,

fp.

[EDIT]: You have now changed the question! [/EDIT]
0
 

Author Comment

by:rgb192
ID: 39604337
but this feature will not be preserved if I save as .csv
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39604339
Yes, but when I started to type my answer there was no mention of "csv" (file) in your question text.
0
 

Author Closing Comment

by:rgb192
ID: 39604344
correct answer before I edited

thank you
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39604348
In order to maintain leading zero(e)s within Comma Separated Value [CSV] format files, the respective columns (fields) will be required to be enclosed within quotes.

For example...
---
"00000000000067", "second column row 1"
"00000000000123", "second column row 2"
"00000000004567", "second column row 3"
---

If you wish to create CSV files with numeric fields in this manner, then you will need a bespoke file creation routine such as this:

[ http://www.mcgimpsey.com/excel/textfiles.html#fixedfield ]
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now