Find/Replace Help. Neophyte OS X user

Oxygen general issues.
bds
Posts: 47
Joined: Mon Jun 26, 2006 10:40 pm

Find/Replace Help. Neophyte OS X user

Post by bds »

I am editing letters transcribed into TEI XML with Oxygen. Our grant project recently had to go through the process of renaming all of the image files for these letters, so now we have to change the <pg ref> tags to match.

Is there a way to use Find/Replace with a variable? What I'd like to do is this:
(origninal file name) rsl002a changed to (new file name) arm03020002001.

I can find, for example, "rsl" or "arm" but I need to find rsl003d and change it to something like arm03020003004. I'm slightly familiar with AppleScript, can I use this to accomplish this task if Find/Replace won't do it?

I apologize if this question makes people smack their foreheads is disbelief. We've got a lot of letters to edit, and if we can automate the process somewhat, it'll be a huge timesaver.

Thanks for your help,

Bridger

OS X 10.3.9, oxygen 7.2
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

The Find/Replace support is able to reuse regular expression groups from a find match in the replace expression, for example if you match rsl003d with the find expression rsl(\d{3})(.+?)(\s*) and the replace expression is arm0302$1004$3 after replacement you get arm0302003004. You did not specify other connection between the match and the result of the replacement but if you need more than reuse of the groups, for example to replace a group of the match ($1, that is 003) with number($1) + 1 (that is 004) you should use an XSLT stylesheet to rename all the image files in your TEI XML documents.

Regards,
Sorin
bds
Posts: 47
Joined: Mon Jun 26, 2006 10:40 pm

Post by bds »

Sorin,

Thank you for your help. I'm going to give the Find/Replace a try before I attempt to figure out the XLST.

Thanks again for your help.

Bridger
Post Reply