|
Writing CSV files is problematic and write to XLS files directly is a nightmare. I would recommend writing to a DIF file which is automatically opened by Excel and can be manipulated to set up rows and columns a little more cleanly than straight CSV format. Granted DIF is a bit complex but it does lend itself well to RPGIV if write to Excel from RPG IV is a goal. Bob Cozzi Cozzi Consulting www.rpgiv.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin Sent: Tuesday, May 20, 2003 9:32 AM To: rpg400-l@xxxxxxxxxxxx Subject: RE: AS400 to EXCEL Is this also true if the CSV fields are all enclosed in quotes? Not apostrophes but quotation marks. The last time I did this, for Excel, I used " and "," and " for the beginning, middle, and ending separators. like this: "John Smith","001234" and it worked as I'd expected it to. --------------------------------------------------------- Booth Martin http://www.MartinVT.com Booth@xxxxxxxxxxxx --------------------------------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: Monday, May 19, 2003 8:34:38 PM To: RPG programming on the AS400 / iSeries Subject: RE: AS400 to EXCEL Actually, the leading zeros are there. Excel just chooses to ignore them in a CSV file, no matter what you try. So when I take this CSV file and send it, as is, to a customer, they think it's wrong. The fact that they are there in the text file does not matter in the least, because the file opens in Excel. If the customer can't see them in Excel, they're not there. Hence the need to create real live Excel format XLS files. If you can't beat 'em, join 'em. Mike E. <snip> I know I point that out every time. 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. <snip> If you click on Format, Cells, then choose the number tab, then select the custom category and type the number of zeros that you want (i.e. 00000 for the zip codes) and then resave it as CSV, then the resulting output CSV file will contain the leading zeros. This can be confirmed by opening the CSV file with notepad. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.