Activity Stream
48,167 MEMBERS
6724 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 10 of 10
  1.     
    #1
    Member
    Website's:
    FunLinkz.com Smyu.in

    Exclamation Help in replacing lines in various files

    Guys I have to do a particular work.
    I don't know how to go about it. Kindly help!

    The work is that-
    Suppose I have 100 (.php) files, all files containing a line like-
    File one- Revision Version- R001
    File two- Revision Version- R002
    and so on.

    I want to replace the whole line in all files with-
    Revision 2.1
    That is Revision Version- XXXX to Revision 2.1 in all files.

    I am using Notepad++
    I think there is a option to do that with N++
    If anyone knows then please share.
    Or if there is any other way let me know..

    Thankyou
    Funny Reviewed by Funny on . Help in replacing lines in various files Guys I have to do a particular work. I don't know how to go about it. Kindly help! :) The work is that- Suppose I have 100 (.php) files, all files containing a line like- File one- Revision Version- R001 File two- Revision Version- R002 and so on. I want to replace the whole line in all files with- Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    you can do this easily using sed on a linux environment
    just need to write a bash script to find and replace these lines

  4.     
    #3
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    You can try the tool here:
    OR

    In Notepad++
    Press Ctrl + F -- > Find In Files

  5.     
    #4
    Member
    Website's:
    FunLinkz.com Smyu.in
    @master- Im on windows env.

    @soft-
    But how can I replace the changing digits?
    Normal replace is easy. But as i told already,
    File one has- Text 001
    File two has- Text 002
    File 3 has- Text 003
    And so on...
    I want to replace the word Text and the changing digits XXX in every file.
    How do I do that?

  6.     
    #5
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Set the search mode to regex (Regular Expressions)



    It will replace Text 001, Text 002, Text 003 with specified text

  7.     
    #6
    Respected Member
    Ok if they are all on a single line ending in the R001-XXXX

    then change the find string to :
    Version- (.*)
    the replace string with :
    Version- 2.1
    And be sure to choose folder and include sub folders if needed and filter *.php .
    Then click the regular expression radio button at the bottom.

    PS Always do a find file alone before adding the replacement text

  8.     
    #7
    Member
    Website's:
    FunLinkz.com Smyu.in
    Thanks a lot Soft. That worked. Damn I should learn more about teh expressions

  9.     
    #8
    Member
    Website's:
    FunLinkz.com Smyu.in
    @ Lock down-
    I figured it out.
    Thanks anyways

  10.     
    #9
    Banned
    Quote Originally Posted by Lock Down View Post
    Ok if they are all on a single line ending in the R001-XXXX

    then change the find string to :
    the replace string with :

    And be sure to choose folder and include sub folders if needed and filter *.php .
    Then click the regular expression radio button at the bottom.

    PS Always do a find file alone before adding the replacement text
    nice and helpful

  11.     
    #10
    Respected Member
    You are all welcome.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Difference between these two lines of code for Wordpress
    By LuDo8 in forum Web Development Area
    Replies: 2
    Last Post: 22nd Jul 2012, 10:58 AM
  2. [VPS] XRumer VPS Servers - 1000 MBPS Lines
    By XRumerGeek in forum Archive
    Replies: 3
    Last Post: 13th May 2012, 12:14 PM
  3. Some Amazing English Lines
    By anaksr in forum General Discussion
    Replies: 3
    Last Post: 27th Jan 2012, 11:26 AM
  4. Php replacing characters !
    By softleaks in forum Web Development Area
    Replies: 8
    Last Post: 30th May 2011, 02:42 PM
  5. Help , Some malware lines automatically adding to my scripts
    By rajeshjsl in forum Webmaster Discussion
    Replies: 10
    Last Post: 7th Feb 2010, 12:01 PM

Tags for this Thread

BE SOCIAL