Replace text in a folder

Discussion in 'Computer Support' started by Chaudhry Nijjhar, Oct 10, 2007.

  1. Hi,

    I have web sites in a folder and want to replace my web site address from


    Is there an easier way than retyping the above two texts after opening each
    page's source text?

    Chaudhry Nijjhar, Oct 10, 2007
    1. Advertisements

  2. Chaudhry Nijjhar

    Evan Platt Guest

    Not that I'm aware of.

    Opening the document in Wordpad, and using Find / Replace will work
    fine though.

    While you're fixing it, start using relative instead of absolute

    What does this mean?

    If you have , and you have a link to say and , you can
    instead have the links be /link1 and /link2. That way if you ever
    change domains, you don't need to do anything.
    Evan Platt, Oct 10, 2007
    1. Advertisements

  3. If you were on *nix, you could do something like this: (untested but should work)

    mkdir temp
    for page in $(ls -ltr | awk '{print $NF}')
    cat $page | sed 's***g' > temp/${page}

    This basically takes all the files in the current directory, changes
    to and dumps them in the temp directory with the same
    name. The default delimiter of the sed command is '/' but since you have a / in your result string
    we have to override it. I chose a '*' but pretty much any special character will work as long
    as it's not in one of the strings you are changing from or to.

    Then all you'd have to do would be

    cp ./temp/* .

    and your pages should be copied back up to the current directory.
    Note: This should also work if you have cywin or MS SFU installed,
    but I don't claim to have tested it.
    Pseudo Silk Kimono, Oct 10, 2007
  4. Thanks. There does not seem to be a simple solution as I thought.

    Chaudhry Nijjhar, Oct 11, 2007
  5. Are you using Windows?

    A google search for windows text replacement tool
    Pseudo Silk Kimono, Oct 11, 2007
  6. Chaudhry Nijjhar

    thanatoid Guest

    This will only work if the files either ARE in .txt format or
    are converted to that format first [it actually MIGHT work in
    ANY format, since your *text* is still just text, regardless of
    proprietary word-processing format, but I'm not 100%sure), but
    if you DL NoteTab Light from,
    freeware, you can open a whole bunch of files (limited only by
    RAM I think, I've opened up to 40 or so) at the same time and
    the "replace" box has an "all documents" option, so with a few
    clicks you can make all the changes in >I think< as many
    documents as your RAM will handle.

    *Generally* it is best to store all your test files in txt
    format anyway, and only make them doc's or pm7's or whatever
    when "using" them.
    thanatoid, Oct 11, 2007
  7. Chaudhry Nijjhar

    why? Guest

    On Wed, 10 Oct 2007 18:49:19 GMT, Chaudhry Nijjhar wrote:

    This time read what you are told and do some looking around for other
    sites if you don't follow the guides you are pointed at.

    Also remember to backup your site and check the backup worked before
    making changes, maybe even 2 backups.
    Allow advertising for a commercial travel agent?
    NTL/VM won't for homeuse, you need a commercial account

    These links need fixed

    'back to Top'

    pointing to files on your PC is silly

    Many / several programmer's text editors have a Replace Text in File

    I like Ultraedit-32 it's not free but well worth the

    Check the features of other editors, from somewhere like the tucows
    shareware / freeware site
    look for
    Development & Web Authoring / Text editors

    I hever used these,
    EditPad Pro sports one of the most extensive search-and-replace features
    of any text editor. Quickly find the part of the file you want to edit.
    Highlight matches, fold lines, and skip over matches and files.
    Instantly make many replacements throughout a (rectangular) selection,
    Powerful text operations engine to process large number of files
    Automatically edits any number of files chosen by a user-supplied list,
    searches the plain text or regular expressions,

    If you don;t like any of those also search

    Another 1
    Find Text in Disk Files
    * search across one drive or all drives
    * search subdirectories, or restrict search by file attributes

    The other method is of course not to put

    As part of any link, you use relative URLs and not absolute URLs.

    With relative URLs you can move the site 'pages' to / from any ISP /
    hosting company.

    why?, Oct 11, 2007
  8. Chaudhry Nijjhar



    You can try "Replace Pioneer", a newly released software in Oct, 2007,
    it's pretty easy to finish your above tasks.
    Further more, it will give you many surprise.

    You can download it at

    The "Four Greate Invention" of Replace Pioneer:
    1) Find text much more accurate:
    Support maximum 7 level filters in pattern match:
    * Paragraph pattern filter: user can select only desired paragraph by
    pattern matching.
    * Paragraph range filter: among the matched paragraphs, user can
    select a range to replace.
    * Line pattern filter: user can select only desired line by pattern
    * Line range filter: among the matched lines, user can select a range
    to replace.
    * Pattern filter: user can find final replace items by this pattern
    * Range filter: among the matched items, user still can select a
    range to replace.
    * Condition filter: the additional powerful condition filter is to
    remove unwanted result, make replace more accurate.

    2) Replace text much more flexible:
    Support user-defined transformation of replace text instead of fixed
    text. The software can replace the found text with any self-defined
    conversion, which make it easier to support flexible context-related
    replacement. A lot of variables and functions are provided to support
    the conversion.

    3) File input/output much more powerful:
    Support file spliting and merging in horizontal and vertical
    Support Web Page and DOS command result as input file type.
    Support UNICODE and Most of the other Encoding types.
    4) Operation much more easier and reliable:

    Recording and re-running scheme make replace and script creating work
    much more easier, and detail recorded and highlighted change make
    software much more reliable.
    , Oct 23, 2007
  9. Chaudhry Nijjhar

    why? Guest

    On Tue, 23 Oct 2007 06:07:01 -0000, wrote:

    Why tell me?

    Learn how to reply to the OP or use piggyback, snip , not bottom posting
    away from the OP's question doesn't help either.

    why?, Oct 23, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.