|
Seeing that I'm creating a csv file, every field is already surrounded by
double quotes.
Here's a sample of the first five columns:
"025","70010060622","70300457","5507","CO ABC"
"025","70010060620","70300412","MELANIE","CO DEF"
When opening the csv file in Excel, I get:
STATUS PICK TICKET ACCOUNT PO SHIP TO
25 70010060622 70300457 5507 CO ABC
25 70010060620 70300412 MELANIE CO DEF
So you can see I'm missing the leading 0 in the status column, and
the alignment is off for the PO column.
Tks,
Glenn Gundermann
ggundermann@xxxxxx
(647) 272-3295
Booth Martin wrote:
> Surround the field with double quotes.
>
> C eval wString = %trim(wString) + ',"' + %editc(Number:
> 'X') + '"'
>
>
> Glenn Gundermann wrote:
>> Hi Everyone,
>>
>> I haven't ventured into the POI world yet so I'm using RPG to create a
>> .csv file in the IFS using the unix APIs like open(), write(), etc.
>>
>> I can't figure out how to keep leading zeros for a numeric field.
>>
>> An old article of Bob Cozzi in MC Press said to use the quote function,
>> e.g. =("001") but I get =(001")" in my column. Perhaps the quote
>> function
>> will only work for people using CPYTOIMPF.
>>
>> I've tried putting in an apostrophe in the front. I get '001 in my cell
>> instead of 001.
>>
>> Secondly, I have a column (P.O. #) that should be character but the data
>> sometimes is numeric. The character data is left-justified and the
>> numeric data is right-justified.
>>
>> Any help would be most appreciated.
>>
>> Tks,
>>
>> Glenn Gundermann
>> ggundermann@xxxxxx
>> (647) 272-3295
--
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.