Topic: looping search and replace (1 of 4), Read 27 times
Conf: VEDIT Macro Language Support
From: joe buckle
Date: Monday, October 13, 2008 02:44 AM

i have thousands of replacements that need to be made in some large files. I've done this in VEDIT using:

Replace(" SEVEN-YEAR-OLD "," seven year old ",BOF+ALL+NOERR)

but, now my replacement lists are in the thousands and it is taking too long to process. is there a way to reformat this macro to run faster?

it takes 20hrs to run each macro and i have about 20 of them to run!

so, i have three questions:

1. can i format my existing macro a little differently and make it run faster thru 10K plus "REPLACE" strings

2. if so, how do i setup a macro to run multiple .vdm files? i have 'replace1.vdm', 'replace2.vdm', ect... and now i have to run the individually, can i batch it?

3. if i cannot edit the above macro to speed it up, how can i create a macro to loop through a file of words where the first string on a line is the 'search' and the next is the 'replace'

for example i have a text files that formatted like:

SEVEN-YEAR-OLD seven year old
SIX-YEAR-OLD six year old
Automobile automobile

i tried to use the Replace macro from 2001, but, it tells me the amount is too large.

Please keep it simple, i'm a novice!

Thanks i love the program!

 


Topic: looping search and replace (2 of 4), Read 20 times
Conf: VEDIT Macro Language Support
From: Ian Binnie
Date: Monday, October 13, 2008 06:05 AM

On 10/13/2008 2:44:28 AM, joe buckle wrote:
>i have thousands of
>replacements that need to be
>made in some large files.
>I've done this in VEDIT using:
>
>Replace(" SEVEN-YEAR-OLD ","
>seven year old
>",BOF+ALL+NOERR)
>
>but, now my replacement lists
>are in the thousands and it is
>taking too long to process. is
>there a way to reformat this
>macro to run faster?
>
>it takes 20hrs to run each
>macro and i have about 20 of
>them to run!
>
>so, i have three questions:
>
>1. can i format my existing
>macro a little differently and
>make it run faster thru 10K
>plus "REPLACE" strings
BOF is an invalid options, should be BEGIN
With a simple replace like this the following should be (slightly) faster:-
BEGIN+SIMPLE+ALL+NORESTORE+NOERR

However, even with huge file 10s of GByte, and a slow processor I am surprised that this should take so long.

You should look for other problems, e.g is your disk nearly full, or recycle bin full.
This can slow Windows to a glacial pace.

Look at "Multiple Replace in Huge Files" in the Macro Language Manual for solutions to the other problems.

 


Topic: Re: looping search and replace (3 of 4), Read 17 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, October 13, 2008 11:18 AM

At 02:48 AM 10/13/2008, you wrote:
>From: "joe buckle"
>
>i have thousands of replacements that need to be made in some large files. I've done this in VEDIT using:
>
>Replace(" SEVEN-YEAR-OLD "," seven year old ",BOF+ALL+NOERR)

Ian gave you some good suggestions.

Switching to the method of all S&R locally in the current buffer and then moving to the next buffer should be much faster - "Multiple Search Replace in Huge Files".

Ted.

 


Topic: Re: looping search and replace (4 of 4), Read 11 times
Conf: VEDIT Macro Language Support
From: joe buckle
Date: Thursday, October 23, 2008 02:51 PM

Thanks that worked and i just batched all the hugh-sr files into one macro!