Correct me if I am wrong as I've only dipped a toe in the Python waters...
Wouldn't the csv module be a workable solution?
Roger Harman
COMMON Certified Application Developer - ILE RPG on IBM i on Power
--
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxx> on behalf of Don Brown <DBrown@xxxxxxxxxx>
Sent: Wednesday, November 16, 2016 2:24 PM
To: Midrange Systems Technical Discussion
Subject: Re: Quoting text strings for SCV output
Thanks John,
You are totally correct - we have built tools that allow .xls and .xlsx
file to be generated with external user defined formatting.
But in this case we have been advised by a third part they will ONLY
accept the information in their specific format.
Also as you pointed out we need to know the data we are providing and yes
we do. The data is actually imported from a MSSQL server and we parse the
data and guarantee no quotes, double quotes or imbedded commas.
I am adding a new option to the export definition that provides an option
to additionally generate a csv file, for that matter I am providing two
options so I can allow the user to dictate if double quotes are required
around alphanumeric fields or not.
This way we can just build up a text string for each record as the excel
file is produced with the appropriate csv delimiters and if the flag is
set write the record to the ifs file. Then both files are attached to the
email and sent.
Would like to thank everyone that replied
Great group with awesome knowledge!!
Don Brown
--
From: John Yeung <gallium.arsenide@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 17/11/2016 06:13 AM
Subject: Re: Quoting text strings for SCV output
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
On Wed, Nov 16, 2016 at 12:30 PM, Kevin Adler <kadler@xxxxxxxxxx> wrote:
If you were to use Python, you could use the xlsxwriter package and
build
an actual Excel file and not worry about CSV.
That's normally *my* pat response when I wedge Python into the
conversation.
However, the OP was very specific about needing to output CSV, and
even then, a dialect of CSV that is NOT produced by Excel. He started
the thread by saying that he's already got POI stuff set up to
generate Excel files, and that it's not meeting his requirements for
this particular task.
John Y.
As an Amazon Associate we earn from qualifying purchases.