Windows Thread, Search replace across multiple XML files in Technical; I need a utility that will replace all instances of certain text across a folder full of XML files (basically ...
26th March 2008, 01:06 PM #1
Search replace across multiple XML files
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.
IDG Tech News
26th March 2008, 01:09 PM #2
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.
26th March 2008, 06:31 PM #3
... also Crimson Editor
26th March 2008, 06:45 PM #4
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
3rd April 2008, 11:17 PM #5
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
4th April 2008, 11:43 AM #6
7th April 2008, 12:07 AM #7
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.
By cgiuk in forum Hardware
Last Post: 24th January 2008, 09:27 AM
By enjay in forum Windows Vista
Last Post: 15th November 2007, 04:51 PM
By sandfie in forum Windows
Last Post: 26th March 2007, 11:45 PM
By richard in forum General Chat
Last Post: 13th March 2007, 01:54 PM
By Fletcher_Bravo in forum Windows
Last Post: 5th July 2006, 04:44 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)