|
Mike: The problem is not with your file nor with Excel. It is just that when Excel sees a field containing just a number (even with leading zeroes) it will interpret that field as a numeric value and show it as such. If you TYPED 0003456 into an Excel spreadsheet cell, it would treat the value as 3,456. The way you tell Excel that a numeric-looking value is Alphanumeric is to precede it with a quote (either ' or " depending upon what you want the default justification to be - left or right in its cell). Try it yourself. Notice what happens, then try creating your csv file with '0006075 in an 8-byte alphanumeric field. Dave Schnee (dschnee@xxxxxxxxxxxxxxxxxxx) Barsa Consulting Group, LLC Mike Smith wrote -------------------------------------- date: Fri, 19 Nov 2004 15:46:44 -0500 from: "Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx> subject: Leading 0's in a CSV file I have a database file that has a character field that contains numeric data(part#) example 0006075. I have created a CSV file and this particular record looks like"0006075", but when it is opened(through EXCEL) it shows as 6075. I have tried putting a single quote at the beginning of the field like "'0006075'. However, this shows with the single quote. Does anyone know how to make the leading zeros appear? Michael Smith iSeries.mySeries.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.