I need a utility that will replace all instances of certain text across a folder full of XML files (basically text). I could knock up a script in an hour or two but there must be a utility out there? I've managed to get Agent Ransack to isolate the files using regular expressions but sadly it won't do replacements.
pspad - link will do a find replace in a directory of files but will be a dumb replace (e.g. doesn't have knowledge of the xml structure).
Alternatively grep/sed/awk should be able to do it.
Cheers
Jona
... also Crimson Editor
HBJB

You can open XML files in dreamweaver. Open one document, setup find and replace, then configure is to do the same for the contents folder that document is stored and sub-folders. It will scan all the files and do the relevant stuff.
Does that make sense? I hope this helps
Thanks for the replies.
In the end it turned out that only a handful of changes were required. I had a folder with about 100 XML files (all similar), but some of which had certain values that needed changing. I used Agent Ransack (my preferred search tool) to find the files with the offending value and then edited manually. Low tech but quicker in this case!
If there are any Regular Expressions experts out there, can you tell me if it is possible to do the following;
1 - Find a number in the following format; [0-9]*\.[0-9][0-9]
2 - Round the value to nearest .5 (eg 0, 0.5, 1, 1.5 etc)
3 - Inset the value back into the text
Any language preference?
Geoff - I suppose you are talking about a programming language, in which case, I would say VB or similar. I could probably code something if I had to, but it seemed like it should be possible with something like RegEx.
There are currently 1 users browsing this thread. (0 members and 1 guests)