MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 14th, 2002, 01:05 PM   #1
jbyrne
Board Regular
 
Join Date: Feb 2002
Posts: 165
Default

I'm having a problem leaving a leading zero on a zipcode when saving it as a csv.

Also, in a another column I have account numbers that are sixteen digits long. Again, when I open the file as a csv, it contains a E+15 extentions. Any help on resolving these 2 issues? I need to save this file as a csv file

jbyrne is offline   Reply With Quote
Old May 14th, 2002, 01:13 PM   #2
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

For the first one, you can format the cella as SPECIAL --> ZipCode

For the second part, Excel is limited to 15 places -- so you can't display 16 significant digits.

Regards!
Yogi Anand is offline   Reply With Quote
Old May 14th, 2002, 01:19 PM   #3
jbyrne
Board Regular
 
Join Date: Feb 2002
Posts: 165
Default

YOGI,

Thanks for your reply. I'm formatting the column under special then zip code. It puts the leading zero there but after saving and closing the csv file. I re-open the file and the leading zeros are gone.

Jim
jbyrne is offline   Reply With Quote
Old May 14th, 2002, 01:21 PM   #4
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Hi,

To save the account numbers, you must treat them as text. I think they will survive the transfer to .CSV and back only if they are recgonized as text.

Bye,
Jay
Jay Petrulis is offline   Reply With Quote
Old May 14th, 2002, 01:32 PM   #5
klb
Board Regular
 
Join Date: Apr 2002
Location: Minnesota
Posts: 821
Default

I have had the same problem saving a zip code in CSV format. I have tried formatting with the special zip code and as text. I have also tried adding a ' at the start of the field. In each case, when I tried to reopen it, Excel thought it was a number and stripped the zero. If I add a " as a label prefix, it will keep the zero.

Also the E+15 is scientific notation. It does not mean that there are more than 15 places after the decimal. Same problems and same solution. Save it with a " prefix.
klb is offline   Reply With Quote
Old May 14th, 2002, 01:53 PM   #6
Tommy Bak
Board Regular
 
Join Date: Feb 2002
Location: Guderup, Denmark
Posts: 287
Default

Hi
I agree with klb.
The problem is not when saving, but when opening a csv-file.
If you take a look at the file in an editon it is ok.
A solution is renaming the file to *.txt
In the importguide you can change the whole column to text before opening the file.
It will now be read properly. (as saved)
regards Tommy
Tommy Bak is offline   Reply With Quote
Old May 14th, 2002, 02:25 PM   #7
PDuPre'
Board Regular
 
Join Date: Apr 2002
Location: Trussville, AL
Posts: 134
Default

Yes. The CSV file is opened automatically by Excel, unlike the .txt file which automatically brings up the wizard. As a result Excel automatically treats all columns as "general" instead of text. Thus, all leading zeros etc. will be wiped since Excel thinks that column is for numbers.

Opening a .txt triggers the wizard when opening it in Excel. However, if you need to save it as a .csv to be imported in another application everything is actually saved in the correct format. One trick is to rename the file from filename.csv to filename.txt before opening it in Excel if you need to edit the .csv file.

Philip
PDuPre' is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes