ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   CSV formatting issue (https://www.excelbanter.com/excel-discussion-misc-queries/231302-csv-formatting-issue.html)

sueasmith31

CSV formatting issue
 
I currently use Excel 2002 with SP3. I have a file I create in a worksheet
and have formatted a numeric field to be text so that I can maintain a 12
character string. I then "Save-As" a CSV file in order for it to be used in
another application. Up until 3 weeks ago, the formatting was correct - now
no matter what I do, when the "text column is converted to CSV, the column
converts to a "general" format and I lose my character string of 12 digits
(leading 0's).
Aside from having to add " " around the string - is there some other
technique I can use so that I am not manually adding all the quotes?

David Biddulph[_2_]

CSV formatting issue
 
Are you sure that you have lost the formatting is lost when you write to the
CSV? Have you tried looking at the CSV with something like Notepad after
the CSV has been written? I think you'll find that the CSV has the format
as you had previously displayed it in Excel.

My guess is that your problem is that you have used Excel to open the CSV,
and at that stage EXCEL has changed the formatting. Don't open a CSV with
Excel if you want the formatting to remain unchanged. [If you do want to
look at the CSV with Excel, don't use File/ Open but instead use Data/
Import External Data and specify the format of each column as text.]
--
David Biddulph

sueasmith31 wrote:
I currently use Excel 2002 with SP3. I have a file I create in a
worksheet and have formatted a numeric field to be text so that I can
maintain a 12 character string. I then "Save-As" a CSV file in order
for it to be used in another application. Up until 3 weeks ago, the
formatting was correct - now no matter what I do, when the "text
column is converted to CSV, the column converts to a "general" format
and I lose my character string of 12 digits (leading 0's).
Aside from having to add " " around the string - is there some other
technique I can use so that I am not manually adding all the quotes?





All times are GMT +1. The time now is 12:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com