>Hi All,
>
>I have a Cursor with Field Name cText in which there are around 2000 records each of length from 10 to 254.
>In these records there is a word say "xyz' in between these Records. The xyz may be at any position inside the record.
>I need to change all the instances of this word xyz to say ABCD or any thing else, for all the records from top to bottom.
>
>Is there any simple way to it in a single command for all the records , other than scanning the entire File from Top to bottom using Scan-Endscan loop.
>
>I also don't want to use FILETOSTR(), occurs() etc as already I have created a cursor for some purpose and have taken Text in SDF.
>
>Thanks.
Don't know if it's relevant in your case .........
What if your string is something like
abcxyz xyzabc xyz abcxyzdef
STRTRAN() will replace all the xyz references - even the ones which are substrings buried inside a larger string.
If that is an issue then you can code the REPLACE command somthing like
REPLACE ALL myString WITH STRTRAN(myString,"xyz","ABCD") ;
FOR myString = "xyz " ;
OR RIGHT(ALLTRIM(myString),1+LEN('xyz')) = ' xyz';
OR ' xyz ' $ mystring;
OR ALLTRIM(myString) == 'xyz'