×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
SED (Strean file EDitor) works great for stream files but I would think that for fixed length record files like source it would be problematic. With RDi at least you have notification of text truncation but I don't know how that would work with source files. Would you lose overflow text or would the overflow write over the source lines and date positions?
-Matt
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of Vernon Hamberg
Sent: Wednesday, February 28, 2018 5:28 PM
To: Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries <wdsci-l@xxxxxxxxxxxx>
Subject: Re: [WDSCI-L] Find/Replace in multiple source members
hi Matt
Yes, the -i flag doesn't work in QShell - I've not tried it in PASE, IIRC.
The solution I found was a compound set of QShell commands that redirect output to a temporary file (not sure about members), then copy that back to the original.
I'm not at my work computer, so I don't have the details.
You can do multiple QShell commands by using a semi-colon separator or the like - again, check the docs.
Good luck - not sure any of this would work with members, but....
Vern
On 2/27/2018 3:29 PM, MWHopkins@xxxxxxxxxxxxxxx wrote:
I was looking into doing something in QShell, but I can't get it to
overwrite the original member. I have this command:
grep -l "Executive Plaza IV" * | xargs sed -e 's/Executive Plaza
IV/10909 McCormick Rd/g'
This works fine, grep finds the source members in the current
directory that have our old address ("Executive Plaza IV") somewhere in the source.
My working directory is /qsys.lib/SOURCELIB.lib/SOURCEFILE.file
grep -l "Executive Plaza IV" *
Then the xargs, runs the sed command on each member which reads the
source and changes every occurrence of 'Executive Plaza IV' to '10909
McCormick Rd', but it just outputs it to the screen. it appears that
the -i flag in the IBMi version of sed is not valid - it is supposed
to overwrite the original file, but I can't seem to figure out how to
redirect the stdout back into the original member name.
So almost....
Matt Hopkins
MFT/EDI/Web Services Project Leader
Information Technology
PDP Group, Inc.
--
This is the Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries (WDSCI-L) mailing list To post a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_wdsci-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=nvvrwTxibvF23vGsXSGzOGUtecVzddGknNTmHE-NG4k&s=t4s52Wmm6Y_sdBDzIJ7EXHC-AihqFQ0jx5umq6VplXw&e=
or email: WDSCI-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_wdsci-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=nvvrwTxibvF23vGsXSGzOGUtecVzddGknNTmHE-NG4k&s=bL2frjVBOEAZkgD__AiFtbKT1jp56uXtkQUTJ7VfVyo&e=.
As an Amazon Associate we earn from qualifying purchases.