?
Solved

phone numbers in exchange

Posted on 2011-04-27
12
Medium Priority
?
211 Views
Last Modified: 2012-05-11
hi all,

I have a spread sheet (csv) with *,000s of phone numbers in, currently they are showing without the initial '0'.

I can  highlight the column, select format and custom and enter 00000000000 which will add the 0 to the front of the number. however when saved and reopened the 0 disappears again.

even if I save as text afterwards the 0 disappears.

the aim - to permanently add the 0 to the front of the phone numbers.

any help is gratefully received.
thanks
gareth
0
Comment
Question by:gareth629
  • 3
  • 3
  • 2
  • +2
12 Comments
 
LVL 10

Expert Comment

by:qbakies
ID: 35476147
What if you just format the cells as text instead of custom?  What version of excel are you using?  Can you open and edit in a text editor instead of excel?
0
 
LVL 34

Expert Comment

by:Rob Henson
ID: 35476274
Using the Custom format doesn't actually change the data, it only affects how it appears.

When saving as CSV or TXT it is only saving raw data.

To get the data to change you would have to use a formula like:

=TEXT(A1,"00000000000")    

Assumes the number in cell A1. This would change the data and would need copying down the relevant number of rows. You could then Copy the result and Paste it back over the original data with Paste Special > Values. The leading zeros should then stay.

Cheers
Rob H
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35476360
Or save it as .xls of course. ;)

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:gareth629
ID: 35476665
thanks guys

Rorya - need to be a csv as it is being imported into a 3rd party  application
qbakies - this works fine for xls but not in csv
rob - love the idea but again once saved to a csv file the 0 is removed.

any other ideas?
thanks
gareth
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35476698
The 0 will get removed only when you open in Excel using Rob's method - if you actually view the csv in Notepad for example they should still be there.
0
 
LVL 10

Expert Comment

by:qbakies
ID: 35476704
What if you save it as a xls to keep the leading 0 and then save that correct xls as csv.

If none of these work you may have to use a text editor.  I often use Notepad++ for editing my csv files.
0
 

Author Comment

by:gareth629
ID: 35476853
qbakies - no joy on the xls to csv I am afraid.

is there a way to globally put in a 0 using a text editor.
0
 
LVL 10

Expert Comment

by:qbakies
ID: 35477214
I believe there is a way in Notepad++.  You can edit vertically which may work for you.  See this article under 'Edit... Vertically!'

http://www.maximumpc.com/article/features/notepad_cheat_sheet_11_tricks_and_tips_plaintext_power_users
0
 
LVL 34

Expert Comment

by:Rob Henson
ID: 35479220
How annoying??? I would have thought that the conversion to text would work.

Not to be beaten, I have found a way.

Change the formula suggested above to:

=" "&TEXT(A1,"00000000000")

Now save as a PRN file (available in 2007, don't know about earlier).

When re-opening the text import wizard pops up, choose Fixed Width and position the separator to the left of the now apparent zero and import that column as text. The zero then stays.

However, can the other application import PRN files???

Cheers
Rob H
0
 
LVL 25

Accepted Solution

by:
Ron Malmstead earned 2000 total points
ID: 35479258
...in excel.

Format the column the way you want it to "look"... with the leading zero I assume "00000000000"

...then select all the cells in the column.

Copy.

Open Notepad

Paste.

Open a NEW* Excel sheet.

Format the first column as TEXT.

Back to notepad.... select all.... copy...

Back to excel... paste.

0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 35479268
btw-  When you open a new sheet...open a new instance of excel...do not simply click file > new, or your results will be continued annoyance.

0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 35479320
Ahh...didn't see the CSV was a requirement.
... if you do the method I just told you, then save as csv, it should keep the value as it was changed.

Doing it that way is actually changing the value, not just a display "mask".
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

621 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