|
From: John Yeung <gallium.arsenide@xxxxxxxxx>double
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 11/16/2016 09:17 AM
Subject: Re: Quoting text strings for SCV output
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
On Wed, Nov 16, 2016 at 8:11 AM, Don Brown <DBrown@xxxxxxxxxx> wrote:
I have a requirement to produce a csv file with all text strings
thatquoted.
Can you guarantee that the textual data doesn't itself contain
double-quotes? If not, then how are they supposed to be handled?
My first question is does anyone have a method to generate an excel
spreadsheet either .xls or .xlsx that can then be saved as a csv file
listwill include double quotes around text cells ?
There isn't a way to create such a CSV via Excel. If Excel is
involved, it will only put quotes around text fields that contain
characters which need to be escaped (the ones I know of are comma,
double-quote, and newline).
Appreciate any suggestions
First and foremost, I personally think the most important thing is to
really understand the requirements. For example, why do you need the
double-quotes around all text fields, and what happens if the field
itself contains a double-quote? (These are only some of the questions
I would have. I would definitely want to know more.) And yes, I'm sure
these requirements are imposed on you by some third party, but I would
want to know from them how exactly they are processing the CSV.
If you truly have a thorough understanding of the exact requirements,
and all the possible corner cases and pitfalls, then you're ready to
write your output directly to IFS as a stream file in your desired
format.
I know I'm shoehorning this in, but if you're willing to use Python,
that would make things much easier. You could either use Python as a
soup-to-nuts solution (including pulling together the data, doing the
calculations, and outputting to CSV), or just as a postprocessor
(accepting either an Excel workbook or an Excel-generated CSV, and
writing out the desired variant of CSV). I imagine there are several
other technologies that are "comparably easy" as Python for this task,
but I have not used them and thus cannot vouch for them.
John Y.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxquestions.
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
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.