global search and replace tool

Discussion in 'Perl' started by Tandem person, Oct 22, 2003.

  1. I am in search of a free tool which can replace multiple strings on
    the particular directory . Please let me know if any such , written in
    perl.


    Thanks
    Athresh
    Tandem person, Oct 22, 2003
    #1
    1. Advertising

  2. Tandem person wrote:
    > I am in search of a free tool which can replace multiple strings on
    > the particular directory . Please let me know if any such , written in
    > perl.


    I think you will have to explain a bit more what you are talking about.
    Directories (at least in the typical standard operating systems) are mere
    lists of files (in the broadest meaning) and
    at least I can't see where strings and directories have anything to do with
    each other.

    jue
    Jürgen Exner, Oct 22, 2003
    #2
    1. Advertising

  3. Hi specification is as below.

    I have few function calls that has to be changed to the new one in the
    whole source files ,present in a single directory. Please let me know
    if any such tools available.
    "Jürgen Exner" <> wrote in message news:<eUxlb.52451$>...
    > Tandem person wrote:
    > > I am in search of a free tool which can replace multiple strings on
    > > the particular directory . Please let me know if any such , written in
    > > perl.

    >
    > I think you will have to explain a bit more what you are talking about.
    > Directories (at least in the typical standard operating systems) are mere
    > lists of files (in the broadest meaning) and
    > at least I can't see where strings and directories have anything to do with
    > each other.
    >
    > jue
    Tandem person, Oct 23, 2003
    #3
  4. Tandem person wrote:
    > Hi specification is as below.
    >
    > I have few function calls that has to be changed to the new one in the
    > whole source files ,present in a single directory. Please let me know
    > if any such tools available.
    > "Jürgen Exner" <> wrote in message news:<eUxlb.52451$>...
    >
    >>Tandem person wrote:
    >>
    >>>I am in search of a free tool which can replace multiple strings on
    >>>the particular directory . Please let me know if any such , written in
    >>>perl.

    >>
    >>I think you will have to explain a bit more what you are talking about.
    >>Directories (at least in the typical standard operating systems) are mere
    >>lists of files (in the broadest meaning) and
    >>at least I can't see where strings and directories have anything to do with
    >>each other.
    >>
    >>jue


    perl -p -i -e 's/Oldname/Newname/' /pathToDir/*
    Donald 'Paddy' McCarthy, Oct 23, 2003
    #4
  5. Tandem person wrote:
    > I have few function calls that has to be changed to the new one in the
    > whole source files ,present in a single directory. Please let me know
    > if any such tools available.


    In general you will need a fully-fledged parser for your particular
    programming language in order to parse the source code of that programming
    language. Otherwise you are running the risk that in addition to the desired
    function calls other text pieces may be changed, too, if they happen to have
    or contain the same character sequence (e.g. in a string or as part of the
    name of some other function) .

    If you think in your particular situation you can accept that risk then
    please have a look at
    - "perldoc -f glob" or "perldoc -f readdir" about how to get the names
    of all files in a directory
    - "perldoc perlop" for information about the "s" operator
    ("substitute"); maybe "perldoc perlre" for information about regular
    expressions
    - and "perldoc -q change" for the FAQ entry about "How do I change one
    line in a file[...]?"

    jue
    Jürgen Exner, Oct 23, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark McKay
    Replies:
    3
    Views:
    1,310
    Thomas Weidenfeller
    Jan 21, 2004
  2. Mary S.

    Find and Replace Tool

    Mary S., Dec 22, 2003, in forum: HTML
    Replies:
    15
    Views:
    715
    Paul Lutus
    Dec 23, 2003
  3. Bob N.

    Search Replace Tool

    Bob N., Jan 2, 2004, in forum: HTML
    Replies:
    12
    Views:
    689
  4. Abby Lee
    Replies:
    5
    Views:
    396
    Abby Lee
    Aug 2, 2004
  5. Replies:
    1
    Views:
    516
    Rainer Weikusat
    Jun 21, 2012
Loading...

Share This Page