+ Post New Thread
Results 1 to 7 of 7
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 ...
  1. #1
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    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.

  2. #2
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    469
    Thank Post
    14
    Thanked 50 Times in 48 Posts
    Rep Power
    23
    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

  3. #3
    Heebeejeebee's Avatar
    Join Date
    Nov 2006
    Location
    Intergalactic Cruise
    Posts
    1,055
    Thank Post
    69
    Thanked 77 Times in 61 Posts
    Rep Power
    35
    ... also Crimson Editor

    HBJB

  4. #4

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,936
    Thank Post
    886
    Thanked 1,692 Times in 1,471 Posts
    Blog Entries
    12
    Rep Power
    446
    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

  5. #5
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34
    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

  6. #6

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Any language preference?

  7. #7
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Time to replace?
    By cgiuk in forum Hardware
    Replies: 11
    Last Post: 24th January 2008, 08:27 AM
  2. Search for files containing...
    By enjay in forum Windows Vista
    Replies: 4
    Last Post: 15th November 2007, 03:51 PM
  3. Restrict "Search files and folders"
    By sandfie in forum Windows
    Replies: 4
    Last Post: 26th March 2007, 10:45 PM
  4. To upgrade or replace
    By richard in forum General Chat
    Replies: 13
    Last Post: 13th March 2007, 12:54 PM
  5. Mass search and replace
    By Fletcher_Bravo in forum Windows
    Replies: 2
    Last Post: 5th July 2006, 03:44 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •