Skip to content

Editing .prjs Wtih Notepad++

AlexRAlexR Cape Town
edited March 2013 in Need Help
Is there a way to do a find and replace for lines of text.


I.e. find "URL=*****" where it finds the text "URL=" and ignores anything after, but replaces the whole line!
and replace with "URL=URL1.com"

I know how to do a simple find and replace in files, but can't work out to find the prefix "URL=" and then replace the whole line with a new one. It's just that the URL=field changes all the time..so maybe some sort of wildcard expression?

Comments

  • AlexRAlexR Cape Town
    I'm using "pop3 server=.*$" 

    and it works, but in the replace field....you have to negate negative expressions. :-)

    so I have to use replace with: 
    %file-C:\\Users\\Admin\\....

    Problem is:
    pop3 pw=.Xú*.öú.òú*æúòúäú˜$¢#èú

    When there are so many regex expressions, because it's encoded, you can't negate them all because I don't what all the regex could be. 

    @sven - is there a way to do a find and replace password across all .prj's? 
    I don't want to manually go into every project everytime the password updates. 
    (maybe something a regex replace expression that says "after / treat all chars as chars and not a regex" - then I can just copy the encoded text in the prj's) BUT best would be if this field was not encoded...since you can access the unencoded data in SER anyway..so what's the point of encoding this here?
  • SvenSven www.GSA-Online.de

    search for: ^pop3 server=.*

    replace with: pop3 server=%file-...%

  • AlexRAlexR Cape Town
    @sven - how do I do that for the password field, since the encoded password is full of regex expressions.

    Search for:   ^pop3 pw=.*
    Replac:           ???

    It's just in the password, can't just replace with ".Xú*.öú.òú*æúòúäú˜$¢#èú"t because it sees the various chars in password encoding as regex expressions!
  • SvenSven www.GSA-Online.de
    Sorry it's working with PsPad, no clue about this Notepad++
  • AlexRAlexR Cape Town
    Working like a charm! Thanks! This will save me hours and hours and hours...
  • the only solution I have found is to put a #file macro in for the password and just keep the same password for all your logins. there is no way around the encryption.
  • AlexRAlexR Cape Town
    @theorbital - there is a way around it. :-) Explained in this thread...hence my excitement. 
  • AlexRAlexR Cape Town
    @theorbital - that is how I have it (#file macro) but I keep a password per group of projects...but with your new tool when it allows email prefixes, I want to take all my T1 projects across various VPS and change it to a #file macro for T1, so need to edit all passwords to reflect new source...
  • AlexRAlexR Cape Town
    Can anyone tell me what type of expression is being used:
    ^pop3 server=.*

    Is that a wildcard?

    This used to work in notepad++ but at moment I can't get it to work...could it be a notepad plugin that I've lost?
  • SvenSven www.GSA-Online.de

    Thats a regular expression. I think there is be an option in notepad++ that you have to check to search with that.

    ^ = starting with 

    . = any char

    * = any length of the previous char.

  • AlexRAlexR Cape Town
    @sven - thanks. 

    For example if I search for:
    ^About_Yourself=.*

    I set it to "regex search" it then finds it. 

    BUT if I insert as replace text: 
    About_Yourself=%spinfolder-C:\Users\Administrator\About Me\%

    It sees the text in the replace file as a regex too!

    So it ends up replacing with:
    About_Yourself=%spinfolder-C:USERSADMINISTRATORABOUTME%

    How do I get around this? It worked last time but for the life of me I can't work out how to solve this now! 

  • SvenSven www.GSA-Online.de
    Use \\ instead of just one \
  • AlexRAlexR Cape Town
    edited April 2013
    @sven - I can use that workaround, but I need to update all password fields and it sees all the encoded chars as a regex too! Any ideas for this? Want to use a standard password on 200 projects, so was going to use a find and replace in files. 

    Question 2:

    Is there a way to do a find end of a line and then add a new line?
    So find:
    Micro_Message=%url%

    and replace with:
    Micro_Message=
    Profile_Image=

    Since as new features get added, they only show up in the prj files when you edit them in SER. 
  • AlexRAlexR Cape Town
    @sven - is there an expression that can replace a whole line since the password field has so many regex's in it and to place a / in front of each one is risky? I see something about newline expressions but didn't quite understand them. 

    So how would I replace all instances of:
    pop3 pw=.Xú*.öú$.òú*æ..úò,úä$ú˜$¢#èú

    With: 
    pop3 pw= úä$ú˜$¢#èú.öú$.òú*æ..úò,

    This can find them: ^pop3 pw=.*

    But what do I put in the replace field, since the replace field can't contain regex and the password encoding has many many regex's?
Sign In or Register to comment.