Search and replace on a large text file 
Author Message
 Search and replace on a large text file

I need to read a large text file into CW5, do a search and replace on some
variables, and write it back out. Is there a quick and simple way to do
this?

Thanks in advance.

Bob



Sun, 14 Oct 2001 03:00:00 GMT  
 Search and replace on a large text file
If the file is not in your dictionary, create a local file declaration
that looks like this...

MyTextFile      FILE,DRIVER('ASCII'),NAME(FileName),PRE(MF)
Record          RECORD
Line            STRING(1000)
        .       .

Set the FileName to what ever your file is called.
LOOP the file by MF:Line and do:
        IF INSTRING(MyTExt,MF:Line,1,1)
                !- Your code here.
        END

This should work the fastest and easiest..

If not put the file of this declaration in your dictionary and do the
name thing.

HTH

On Wed, 28 Apr 1999 14:27:47 -0700, "Bob Robesky"

Quote:

>I need to read a large text file into CW5, do a search and replace on some
>variables, and write it back out. Is there a quick and simple way to do
>this?

>Thanks in advance.

>Bob

----

Riley Berton
Law Audit Services



Mon, 15 Oct 2001 03:00:00 GMT  
 Search and replace on a large text file
That works. Thanks.

Bob


Quote:
> If the file is not in your dictionary, create a local file declaration
> that looks like this...

> MyTextFile FILE,DRIVER('ASCII'),NAME(FileName),PRE(MF)
> Record RECORD
> Line STRING(1000)
> . .

> Set the FileName to what ever your file is called.
> LOOP the file by MF:Line and do:
> IF INSTRING(MyTExt,MF:Line,1,1)
> !- Your code here.
> END

> This should work the fastest and easiest..

> If not put the file of this declaration in your dictionary and do the
> name thing.

> HTH

> On Wed, 28 Apr 1999 14:27:47 -0700, "Bob Robesky"

> >I need to read a large text file into CW5, do a search and replace on
some
> >variables, and write it back out. Is there a quick and simple way to do
> >this?

> >Thanks in advance.

> >Bob

> ----

> Riley Berton
> Law Audit Services



Mon, 15 Oct 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Search and replace text in a file based on a specific line

2. Looking for best text search/replace method

3. HELP! Full-text search in large DB

4. HELP! Full-text search in large DB

5. Scan and Replace-Routines for Large Files

6. 2-file awk search-and-replace

7. in-file search/replace question without using mv or cp

8. searching and replacing a string within a file with rexx

9. search/replace in long files

10. Searching Large TPS Files

11. Using Debug to search a very large file?

12. How to replace characters in a text file

 

 
Powered by phpBB® Forum Software