Topic: It shouldn't be this difficult... (1 of 4), Read 170 times
Conf: Search and Replace
From: Rod Davis
Date: Wednesday, July 09, 2003 09:34 PM

Simple task: I have a collection of files in which I want to make a series of changes, e.g. change "ALCO164.jpg" to "12345.jpg" wherever it appears. There will be about 100 such changes, and I have a Rexx script doing the overall control and calling VEDIT for each set of changes. The commands all look like this:
c:\windows\...VEDIT.EXE -q-c "Replace('ALCO164.jpg' '12345.jpg',BEGIN+ALL+NOERROR) Xall" c:\windows\...\*.htm.*
The problem is that only one file gets changed.
Note that the file spec *.htm.* selects files named, e.g. ALCO164.htm.IH
What exactly does Xall do? I could find no documentation at all for it!
-R.

 


Topic: It shouldn't be this difficult... (2 of 4), Read 184 times
Conf: Search and Replace
From: Christian Ziemski
Date: Thursday, July 10, 2003 04:12 AM

Rod Davis wrote:

> Simple task: I have a collection of files in which I want to make a
> series of changes, e.g. change "ALCO164.jpg" to "12345.jpg"
> wherever it appears. There will be about 100 such changes,
> and I have a Rexx script doing the overall control and calling
> VEDIT for each set of changes. The commands all look like this:
> c:\windows\...VEDIT.EXE -q-c "Replace('ALCO164.jpg' '12345.jpg',
> BEGIN+ALL+NOERROR) Xall" c:\windows\...\*.htm.*
> The problem is that only one file gets changed.
> Note that the file spec *.htm.* selects files named, e.g. ALCO164.htm.IH


I would suggest using WILDFILE.VDM.
The online docu should help there.
In the topic "Supplied Macros - WILDFILE - Fully Automating WILDFILE.VDM"
there is a description how to create a batch which calls VEDIT for such a task.

The easiest way would be (IMHO):
1.) Create a VEDIT macro with all the replace commands which are to be executed
for every file.
2.) Create an .INP file as described in the help to choose the files and to
execute the created macro from 1.)
3.) Create a batch file to call VEDIT (have a look into the supplied AUTOWILD.BAT)
using the created INP file from 2.)


> What exactly does Xall do? I could find no documentation at all for it!

The online docu says:

-- Xall Save all files (without prompting) and exit VEDIT.
-- It saves all modified buffers that have an assigned filename.
-- This is a fast way to exit VEDIT, saving all possible files.
-- Note: Only modified files are rewritten to disk.


Christian

 


Topic: It shouldn't be this difficult... (3 of 4), Read 184 times
Conf: Search and Replace
From: Christian Ziemski
Date: Thursday, July 10, 2003 10:27 AM

Ooops.

I wrote:

> replace("very old","really new",ALL+NOERR)
> replace("old","new",ALL+NOERR)

But it should read:

replace("very old","really new",BEGIN+ALL+NOERR)
replace("old","new",BEGIN+ALL+NOERR)


Christian

 


Topic: It shouldn't be this difficult... SUCCESS (4 of 4), Read 183 times
Conf: Search and Replace
From: Rod Davis
Date: Thursday, July 10, 2003 06:45 PM

I decided that the macro could handle large numbers of files, so went ahead with it. After a few tense moments caused by a couple of (unexpected!) read-only files, all went well.
This sucker is /fast/.
Thanx again for your help.
-R.