|
The program that creates the csv file is a propritary PC program.
I have to deal with whatever it creates.
I have informed the user that the description can not have embedded
commas.
They load the base data from the i, so they have control of that
information.
Thanks,
Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical
Solutions V5R2
IBM Certified Specialist- e(logo) server i5Series Technical Solutions
Designer V5R3
IBM Certified Specialist- e(logo)server i5Series Technical
Solutions Implementer V5R3
________________________________
From: Booth Martin <booth@xxxxxxxxxxxx>
To: RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
Sent: Fri, July 16, 2010 1:54:46 PM
Subject: Re: Parsing a CSV file with embeded commas in text field
Can you get the source of the csv file to put quotation marks around
all
alpha fields? That makes your job a whole lot easier.
On 7/16/2010 10:27 AM, Alan Shore wrote:
apparent from
Hi Jeff
never heard of the GETTOK routine until you mentioned it
Google found this (among others)
http://www.ibm.com/developerworks/wikis/display/webquery/GETTOK
+-+Extracting+a+Substring+(Token)
However, when I've needed to extract data from a csv file, I've used
CPYFRMIMPF
This may not be of help to you as I believe (although its not
your request) that you want the string Apples, Red Delicious 88ct tobe
in one fieldusing
You need this to be enclosed in quotes
"Apples, Red Delicious 88ct" for this to work
It will be interesting to see if someone else has an answer for you
the GETTOK routineTo
Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill
Jeff Young
<cooljeff913@yaho
o.com>
Sent by: rpg400-l@xxxxxxxxxxxxbounces@ cc
rpg400-l-
midrange.combject
Su
Parsing a CSV file withembeded
07/16/2010 10:09 commas in text fieldsome
AM
Please respond to
RPG programming
on the IBM i /
System i
<rpg400-l@midrang
e.com>
I am using the GETTOK routine to parse records from a csv file where
of therecall
character fields have embedded commas.
I seem to recall that this was addressed in the past, but I do not
how toSolutions
do it.
ex: ...,Apples, Red Delicious 88ct,nnnn,nnnn ....
All help will be appreciated.
Thanks,
Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical
V5R2Solutions
IBM Certified Specialist- e(logo) server i5Series Technical
Designer V5R3mailing list
IBM Certified Specialist- e(logo)server i5Series Technical
Solutions Implementer V5R3
--
This is the RPG programming on the IBM i / System i (RPG400-L)
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.
This is the RPG programming on the IBM i / System i (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.
--
This is the RPG programming on the IBM i / System i (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.