|
>>As soon as you attempt to export a >>file with New Jersey zip codes in it, you will see that Excel will not keep >>the leading zeros of a CSV file, no matter what you do. Believe me, I've >>tried. >Sure it will. Going back to the days of Lotus 1-2-3, you can control the >formatting of a cell by a leading character. Place a single apostrophe in front >of the text you enter into a cell and it becomes a left-aligned text entry even >if the entire data portion are digits. >Try it when keying in Excel (or Lotus 1-2-3 <g>) and you'll see what I mean. >You should see the little green triangle in the upper left corner of the cell, >signifying it is a text formatted cell. Very familiar with that trick. Works like a charm in XLS files. >It also works on importing text from a >CSV, as best I can recall. If you can get this to work in a CSV, then I'm obviously doing something wrong, so please help me out. If I copy the following text into a file, end the filename in .csv and open it in Excel, I do get text formatting, but I also get the apostrophes displayed. '07739,'07739,'07739,'07739,'07739,'07739,'07739,'07739 '07740,'07740,'07740,'07740,'07740,'07740,'07740,'07740 '07741,'07741,'07741,'07741,'07741,'07741,'07741,'07741 '07742,'07742,'07742,'07742,'07742,'07742,'07742,'07742 '07743,'07743,'07743,'07743,'07743,'07743,'07743,'07743 '07744,'07744,'07744,'07744,'07744,'07744,'07744,'07744 '07745,'07745,'07745,'07745,'07745,'07745,'07745,'07745 '07746,'07746,'07746,'07746,'07746,'07746,'07746,'07746 '07747,'07747,'07747,'07747,'07747,'07747,'07747,'07747 '07748,'07748,'07748,'07748,'07748,'07748,'07748,'07748 '07749,'07749,'07749,'07749,'07749,'07749,'07749,'07749 '07750,'07750,'07750,'07750,'07750,'07750,'07750,'07750 '07751,'07751,'07751,'07751,'07751,'07751,'07751,'07751 '07752,'07752,'07752,'07752,'07752,'07752,'07752,'07752 '07753,'07753,'07753,'07753,'07753,'07753,'07753,'07753 '07754,'07754,'07754,'07754,'07754,'07754,'07754,'07754 '07755,'07755,'07755,'07755,'07755,'07755,'07755,'07755 '07756,'07756,'07756,'07756,'07756,'07756,'07756,'07756 '07757,'07757,'07757,'07757,'07757,'07757,'07757,'07757 I suppose it is technically formatted as text, but my users weren't very happy with the unwanted apostrophes. Believe me, I have tried everything I can think of to fool Excel into treating an all numeric cell in a CSV as text. Leading and trailing spaces don't work. Single apostrophes (or any other leading text character) show up. I've tried low hex values, and they show up as funny characters or little rectangles. If there is a way to make this work in Excel '97, I would be happy to know about it, and I would recommend it to anyone who asks. But I certainly haven't found it. Mike E.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.