ajbritton Posted March 26, 2008 Posted March 26, 2008 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.
Jona Posted March 26, 2008 Posted March 26, 2008 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
FN-GM Posted March 26, 2008 Posted March 26, 2008 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
ajbritton Posted April 3, 2008 Author Posted April 3, 2008 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
ajbritton Posted April 6, 2008 Author Posted April 6, 2008 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now