|
H Brad
Here's the thing I did to get UTF-8 output in QShell, which doesn't
natively do that - this is in a RPGLE program where I have to modify a
value in an XML file (for and XLSX file) that I don't know until I've
finished processing all the rows.
sedCmd = 'QSH CMD(+
''export QIBM_CCSID=1208 +
&& sed "' + %char(pLineFrom) + ',' +
%char(pLineTo) +
' s/' + pSearchFor +
'/' + pReplaceWith + '/';
if pReplaceAll;
sedCmd += 'g';
endif;
sedCmd += '" ' + pFile + ' > /tmp/temp' + jobNbr + '.tmp +
&& mv /tmp/temp' + jobNbr + '.tmp ' + pFile + ''')';
The command becomes something like this -
export QIBM_CCSID=1208 && sed "5, 6 s/tagname/realvalue/g" pFile >
/tmp/temp123456.tmp && mv /tmp/temp123456.tmp pFile
The point here is that the && continuations put everything in the same
QShell job - I think that mattered when I first found this solution for
replacing the changes from sed into the from file - Qshell version of
sed does not have the "replace-in-place" option that other versions of
sed do - and I don't remember if PASE' version does, or if there were
other problems I had.
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.