Friday, May 29, 2009

(Q&A) Problem Regarding CSV Files

From: Kropeck

Question:
Hi As400 Guru,
I have a problem regarding on CSV files.
I have made a program that will produce records in CSV format.
But when i downloaded it and opened it in Excel. The card numbers are different.
Instead of 1234567891234567, the number in excel would come out like 4.321+13 sumthin like that. But when i check it in RPG card number is OK and also when CSV is opened using notepad.
Thank you!!

Answer:
I think that this is Excel's limitation to handle large number (numbers with length greater than 15), it is being automatically converted to exponential notation value. This happens when you double click the CSV file then Excel will open the file. You can avoid this by changing your file extension, instead of CSV you may use other extensions, for example you can use XXX as your file extension. this way when you open it with excel it will ask you on how to open the file, if it's delimited and it will also ask you the column format, whether you like it as character, numeric or general format.
Hope this helps. Thanks.

No comments:

Post a Comment