• Need help search and replace with wildcards

    Locked
    3
    1 Votes
    3 Posts
    1k Views
    Patrick Huebgen6P

    Thank you - worked perfect!

  • Notepad ++ doesn't remember position in document after changing tab

    Locked
    4
    0 Votes
    4 Posts
    970 Views
    Nat TardisN

    Thank you for notifying us !

  • Replace everything before certain key

    Locked
    3
    1 Votes
    3 Posts
    4k Views
    Trung Michal NguyenT

    I knew there was some command users use but couldn’t find what kind of. I did some replacing by myself but hit the wall everytime i had to replace Line xxxx and couldn’t think of how to reference before the “id”. Anyway thank you very much for helping me and tips for my next post.

  • Search and replace inside the same blocks

    Locked
    4
    0 Votes
    4 Posts
    863 Views
    guy038G

    Hello, @anatol-sam,

    I think so. But we need some details, about the text to change !

    Simply, give us one or several example(s) of the bunch(es) of text which you want to search AND the corresponding text which you expect, for each bunch, after the S/R operation !

    To be sure that your text will NOT be interpreted with the Markdown syntax, used on this site, simply wrap all your BEFORE and AFTER stuff with, either :

    The starting line ```z and the ending line ``` ( using the backquote / backtick character ` )

    The starting line ~~~z and the ending line ~~~ ( using the tilde character ~ )

    For instance :

    I have :

    ```z
    Your BEFORE stuff
    ```

    And I would like :

    ~~~z
    Your AFTER stuff
    ~~~

    So, in short, give us some material to think about :-))

    Best Regards

    guy038

  • Hard to explain but need help

    Locked
    7
    0 Votes
    7 Posts
    1k Views
    guy038G

    Hello, @anthony-lovelady, @terry-r, @david-bailey, and All

    As Terry, I was confused about the final goal of the OP. Luckily, Terry almost clarified the problem :-)

    I say, “almost”,  because we must take in account some other points :

    We may consider that the initial text contains blocks, separated by blank lines. These blank lines must be deleted, before calling the Column editor !. Otherwise, the numbering wouldn’t be made of consecutive numbers :-((

    May be, the lines Cheat0_N = and Cheat0_O= may contain numbers different from 0, like, for instance, Cheat28_N = or Cheat72_O=

    Also, the word Cheat, in the original text, may be written in lower-case or with any case

    Finally, Terry, I think that you forgot an equal sign =, after the part Cheat\d+, in the second regex, at STEP 3

    So, given an initial text, as below :

    Cheat0=“Arms Connect”,80047F77 0022,81047F88 1836,81047F96 E836 Cheat28_N = Cheat72_O= cheat3=“First_Test”,702A65B7 0198,658CC6D0 9215,8921BF80 C123 cheat3_N = cheat3_O= Cheat12=“Example”,C9245F81 990A,42C845D1 0000,95AD692F A23B Cheat0_N = Cheat2_O= cheat07=“end of the Test”,004F2227 C52D,623C78B2 52F3,692A7D6C 5520 cheat00_N = cheat100_O=

    Then, this first regex S/R :

    SEARCH (?i-s)Cheat\d+_(N|O).+\R?|(^\h+\R)+

    REPLACE Leave EMPTY

    Would give the text, below :

    Cheat0=“Arms Connect”,80047F77 0022,81047F88 1836,81047F96 E836 cheat3=“First_Test”,702A65B7 0198,658CC6D0 9215,8921BF80 C123 Cheat12=“Example”,C9245F81 990A,42C845D1 0000,95AD692F A23B cheat07=“end of the Test”,004F2227 C52D,623C78B2 52F3,692A7D6C 5520

    Now, after performing the Column editor action, with a decimal starting number 0, we obtain :

    0Cheat0=“Arms Connect”,80047F77 0022,81047F88 1836,81047F96 E836 1cheat3=“First_Test”,702A65B7 0198,658CC6D0 9215,8921BF80 C123 2Cheat12=“Example”,C9245F81 990A,42C845D1 0000,95AD692F A23B 3cheat07=“end of the Test”,004F2227 C52D,623C78B2 52F3,692A7D6C 5520

    Finally, using the second regex S/R, below :

    SEARCH (?i-s)(\d+)Cheat\d+=(.+?”),(.+)(\R)

    REPLACE cheat\1_desc = \2\4cheat\1_enable = true\4cheat\1_code = “\3”\4

    You should get the expected text :

    cheat0_desc = “Arms Connect” cheat0_enable = true cheat0_code = “80047F77 0022,81047F88 1836,81047F96 E836” cheat1_desc = “First_Test” cheat1_enable = true cheat1_code = “702A65B7 0198,658CC6D0 9215,8921BF80 C123” cheat2_desc = “Example” cheat2_enable = true cheat2_code = “C9245F81 990A,42C845D1 0000,95AD692F A23B” cheat3_desc = “end of the Test” cheat3_enable = true cheat3_code = “004F2227 C52D,623C78B2 52F3,692A7D6C 5520”

    Best regards,

    guy038

  • Default language: Arduino not found

    Locked
    2
    0 Votes
    2 Posts
    696 Views
    PeterJonesP

    I am pretty sure [1] that Arduino uses C/C++ by default, so choosing Settings > Preferences > New Document to C++ would be what you want.

  • XML Tools - XML Parsing Error points to wrong line

    Locked
    2
    0 Votes
    2 Posts
    3k Views
    chcgC

    Maybe you want to create an issue here https://github.com/morbac/xmltools/issues

  • Applying Defined Language to all open files

    Locked
    6
    0 Votes
    6 Posts
    2k Views
    PeterJonesP

    Assuming it’s a User Defined Language, I found the time to hack together a PythonScript to do it. This example assumes the UDL is named “Markdown” (because that’s a UDL I have), but you just have to change the udl_name in the code.

    # https://notepad-plus-plus.org/community/topic/16420/applying-defined-language-to-all-open-files # For each open file # * activate the file's tab # * select the Language menu's item for the MySuperCool UDL, or whatever it's named udl_name = 'Markdown' # change as needed #console.clear() #console.show() files_tups_list = notepad.getFiles() curr_file = notepad.getCurrentFilename() console.write("current:"+curr_file+"\n") for tup in files_tups_list: file = tup[0] console.write("file:"+tup[0]+"\t") console.write("id:"+str(tup[1])+"\t") console.write("idx:"+str(tup[2])+"\t") console.write("view:"+str(tup[3])+"\n") notepad.activateFile(file) keep = notepad.getCurrentLang() #console.write("lang:" + str(notepad.getCurrentLang()) + "\t" + str(int(notepad.getCurrentLang())) + "\n") # notepad.setLangType(LANGTYPE.USER) # couldn't find a way to make this select a particular UDL #notepad.menuCommand(MENUCOMMAND.LANG_USER) # ditto notepad.runMenuCommand('Language', udl_name) # here's one that will #console.write("lang:" + str(notepad.getCurrentLang()) + "\t" + str(int(notepad.getCurrentLang())) + "\n") #notepad.setLangType(keep) #console.write("lang:" + str(notepad.getCurrentLang()) + "\t" + str(int(notepad.getCurrentLang())) + "\n") notepad.activateFile(curr_file)

    I’ve left in my debug code (commented) so you can enable extra prints to help you see what’s going on.

    If you don’t want to set every file to the UDL, but just some of the open files, you can wrap it in an “if” block.

    Note, the thread https://notepad-plus-plus.org/community/topic/11341/using-a-user-defined-language-as-default/11 has similar content, but changes to a UDL it when you switch to a matching file (so it’s got an example of what the “if” block might look like)

  • #if...#endif blocks in C

    Locked
    1
    0 Votes
    1 Posts
    503 Views
    No one has replied
  • G-Code posts finicky

    Locked
    5
    0 Votes
    5 Posts
    1k Views
    PietertjeP

    Ah ok no worries, I’ll just dive into getting the PostProcess right then.
    Also, it doesn’t have to be precise for the machine, it’s for the guy that’s checking the program before it gets sent (me). I’m a bit… odd at times and keep tinkering with stuff untill I get it to work the way I want it to, or make it work to the best of capabilities; either mechanical or mental.
    This instance it’s for an older Fanuc 0m that needs the toolcall and toolchange on different lines, with 32K (yes K) memory, so nothing super exciting happening, it’s just that I see a challenge when my expectations meet reality, and in this case I needed a bit of a help.
    Thanks!

  • 0 Votes
    2 Posts
    621 Views
    Scott SumnerS

    @DemolisherMK1

    You could do something like this using one of the scripting languages, e.g. Pythonscript. You’d add a notification callback for the “character added” event, and then substitute whatever you want for the original character. Maybe some other ways to accomplish it as well.

  • Seach a word and pick the 100th result

    Locked
    7
    1 Votes
    7 Posts
    2k Views
    guy038G

    Hi, @tarik, @scott-sumner, @terry-r and All,

    Thanks, Scott, for your additionnal information. Look like I was a bit tired to develop ;-))

    Of course, as Scott mentioned, your can, either, perform a sensitive to case OR a insensitive to case search, with the respective generic regexes :

    (?s-i)(?:.*?(X)){N}.*?\K\1 ( Sensitive )

    (?si)(?:.*?(X)){N}.*?\K\1 ( Insensitive )

    Cheers,

    guy038

  • notepad++ page

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    PeterJonesP

    ++@dinkumoil: that’s a great solution, if you never use the “Search on Internet”, and only want one selected-text-to-website command.

    @vincity-taymodaimo, If you want to be able to have more than one, you can add it (or them) to the Run menu by the following instructions:

    [assumes a normal installation of Notepad++]:

    Save all files and close all instances of Notepad++

    Open one instance of Notepad++. Don’t open any other instances while executing the following steps, unless directed by these steps

    Open %AppData%\Notepad++\shortcuts.xml

    Go down to the <UserDefinedCommands> section; there should be entries like launch in Firefox or wikipedia search or similar

    add a line similar to the following

    <Command name="Translate DE to EN" Ctrl="no" Alt="no" Shift="no" Key="0">https://www.deepl.com/translator#de/en/$(CURRENT_WORD)</Command> you could add a keyboard shortcut here, if you know the KEYCODE for the given key; but I find it easier to follow the final step, below if you have other commands, do them similarly

    Save %AppData%\Notepad++\shortcuts.xml, close the file, then close Notepad++

    Open Notepad++

    The Run menu should contain Translate DE to EN. Highlight a German word in Notepad++; Run > Translate DE to EN. Your default browser should open a window or tab with the translation.

    If you want to assign a keyboard shortcut,

    go to Run > Modify shortcut/delete command (or Settings > Shortcut Mapper > Run Commands), select Translate DE to EN Modify Select your desired shortcut Ok Close
  • Search in one file DELETE in another (YASADT)

    Locked
    6
    0 Votes
    6 Posts
    1k Views
    Terry RT

    @Gregory-Mompezat
    thanks for upvotes. I’m glad it worked without issues. I’m sad because I spent some minutes writing some of the text from the image, copying it and duplicating, then changing some of the text, when I didn’t see the “pastebin” link below.

    Terry

  • multiple text files replace help

    Locked
    5
    0 Votes
    5 Posts
    1k Views
    Vasile CarausV

    use GrepWin or TextCrawler for multiple search and replace in million of files all at once :)

    https://github.com/stefankueng/grepWin/releases/tag/1.8.1

    https://www.digitalvolcano.co.uk/textcrawler.html

  • 1 Votes
    4 Posts
    855 Views
    gapsfG

    @Scott-Sumner
    Yep, “Shift+Ctrl+Arrow”.
    Your advice helped.

  • Emmet: "Go to matching pair" won't work?

    Locked
    1
    0 Votes
    1 Posts
    495 Views
    No one has replied
  • Cloud setting in Notepad++ is deleting files

    Locked
    2
    0 Votes
    2 Posts
    662 Views
    Scott SumnerS

    @twentyTwo

    when an unsaved tab is closed in notepad++, it is deleted

    Yes, that’s the idea. If you close an unnamed tab (e.g. “new 1”, “new 5”, “new 23”) without saving it to a hard-named file first, it and its data are discarded.

  • Is there a current Manual?

    4
    0 Votes
    4 Posts
    3k Views
    AZJIO AZJIOA

    And I’d be happy to help with writing that manual.
    And what’s stopping you from doing this?
    When a person wants to help, 3% of the total work is implied.

  • NPP Sessions

    6
    0 Votes
    6 Posts
    2k Views
    Scott SumnerS

    @mikeguyre said:

    The File open dialog for Load Session defaults to the folder of the last file you had opened so you have to navigate to find the session file.

    Yes, this is annoying, but if you keep all of your session config files in one folder you can put a link to that folder in your Windows Favorites so that it is only a few extra navigation clicks away.

    Jim’s solution sounds better…try it.