|
View previous topic :: View next topic
|
| Author |
Message |
cvadlamudi
New User
Joined: 19 Apr 2007 Posts: 68 Location: India
|
|
|
|
Hi All,
Is there any command in TSO, to change a string in particular lines only.
In the below example, all 'XXX' in the lines with string 'AAA' are changed to 'YYY'.
Input :
111 AAA 000XXX
222 AAA 000XXX
333 BBB 000XXX
444 CCC 000XXX
555 AAA 000XXX
Output :
111 AAA 000YYY
222 AAA 000YYY
333 BBB 000XXX
444 CCC 000XXX
555 AAA 000YYY
Thanks,
Mouli |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
x all
f all 'AAA'
chg all 'XXX' 'YYY' nx |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Not in a single command but you might try something like:
| Code: |
X ALL
F 'AAA'
FLIP
C 'XXX' 'YYY' |
or
| Code: |
| X ALL; F 'AAA'; FLIP; C 'XXX' 'YYY' |
I'd suggest creating a member for testing before doing this on something "real". |
|
| Back to top |
|
 |
cvadlamudi
New User
Joined: 19 Apr 2007 Posts: 68 Location: India
|
|
|
|
Thanks a lot, Dick Brenholtz and dick scherrer
I was looking this for a long time... Thanks
Regards,
Mouli |
|
| Back to top |
|
 |
mmwife
Super Moderator

Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Mouli,
If you need a 1 cmd solution you can try:
| Code: |
c all p'AAA ===XXX' p'AAA ===YYY' |
|
|
| Back to top |
|
 |
|
|