• insert increasing number before/after specified word

    5
    0 Votes
    5 Posts
    545 Views
    Terry RT

    @SilentBronyRain said in insert increasing number before/after specified word:

    I need to insert a number every time selected word appears in the document.

    As well as a scripting option it can also be achieved with regular expressions and other built-in functions:

    Insert line number at the beginning of each line Mark (bookmark) each line with the word Polka in it Cut the marked lines and paste into another tab Insert an increasing number at the end of each line (this can start at 0) move the just inserted line number (step #4) to the position behind the word Polka Cut/Copy these lines back into the original file, at end Sort the lines by using the line number inserted step #1 Remove the line numbers

    I deliberately haven’t provided the actual commands, I will leave that for the OP to figure out. They aren’t difficult and could be a worthwhile learning experience. When inserting numbers in step #1 it’s important to tick the box “leading zeros” as otherwise sorting will not put the lines back into the original order.

    Note this works when only 1 “key word” is on each line. It would be possible to re-work the above process with multiple key words on each line but that would be a complicated exercise.

    Terry

  • How to bookmark group of selected line

    14
    0 Votes
    14 Posts
    715 Views
    Alan KilbornA

    @Shekhar-Singh

    set up the operation in the Mark window:
    Find what: \R
    Bookmark line: checked
    In selection: checked
    Search mode: Regular expression start macro recording press the Mark All button press Ctrl+F2 (which is Toggle Bookmark) end macro recording save and name macro

    With selection:

    6dff4655-1931-40ee-a72d-f7a7c6efcd73-image.png

    Run macro to get:

    5cd7d54c-2efb-4bbf-a911-94496bcabb26-image.png

    Without selection:

    21fcb4e0-929e-486b-a9bc-c15af1c71cd6-image.png

    Run macro to get:

    a0954f8b-9190-429a-a87e-edf127f2caea-image.png

  • How do I change the size of text. I don't know what I did

    3
    0 Votes
    3 Posts
    197 Views
    Majestic HelliumM

    @Alan-Kilborn thanks wasn’t expecting a response so quick and what you said is what I did I was scrolling through a very large file and I guess I accidently pressed control

  • Remove columns from a file

    25
    0 Votes
    25 Posts
    11k Views
    Alan KilbornA

    @guy038 said in Remove columns from a file:

    Why didn’t you choose the Alt + B shortcut for the Begin/End Select command ?

    It is a possible choice, certainly.

    I didn’t choose it because to me, Alt + letter means I’m opening a main menu category, i.e., Alt+f drops the File menu, Alt+s drops the Search menu, etc.

    And, if I have to press Alt, I usually have to “find the key”, whereas Shift and/or Ctrl are just more naturally located.

    Actually, from long Notepad++ usage, Alt in combination with Shift – for column mode selecting – is an “easy find” as well. But Alt by itself is harder for me.

    So if I’m going to make a feature request, I take advantage of that and suggest things that work well for me!

  • 0 Votes
    5 Posts
    363 Views
    GitHubinatrixG

    OK, thank you for making it extra clear

  • Default UDL Dark over Light

    5
    0 Votes
    5 Posts
    584 Views
    guy038G

    Hello, @lycan-thrope, @ekopalypse and All,

    Ah…, very clever, Lycan ! You totally deserve the N++ guru title ;-))

    So, given you last picture of your right-click context menu, this means that your contextMenu.xml configuration file contains the section :

    <Item id="0"/> <Item MenuEntryName="Language" subMenuId="language-userDefinedLanguage" name="User Defined Language" MenuItemName="Dark_dBASEPlus"/> <Item MenuEntryName="Language" subMenuId="language-userDefinedLanguage" name="User Defined Language" MenuItemName="dBASEPlus"/> <Item id="0"/>

    and that you found out the missing part subMenuId="language-userDefinedLanguage" name="User Defined Language" at line 72 of the ...\localization\english.xml file in order to get your functional DBasePlus commands on a right-click action. Wow…, respect !

    Best Regards,

    guy038

  • Modify behaviour of Enter

    10
    0 Votes
    10 Posts
    2k Views
    Alan KilbornA

    @Sabuzaki said in Modify behaviour of Enter:

    I discovered that my notes are going upwards > whatever I enter today I want to be at the top of the <blabla>.txt file, and whatever is from yesterday, it’s somewhere down there…

    I suppose this makes some sense, in a limited fashion.

    I keep notes in .txt files as well. Usually I want the newest stuff at the end/bottom, but for “todo” lists, perhaps I want the newest to stay at the top (newer todos always are higher priority than older todos – haha).

    Your goal would make sense if such a list were only single line items, but my todos tend to span a few lines, in which case your idea for how it should be would not work (unless one has the mental acuity to type multiple-lines of related text in reverse order; not likely).

    Here’s an (obfuscated) example of my recent todos, just so what I’ve said above is illustrated structurally/visually:

    bpyuoc zande/gsettxtq eskh: bfs bbmcgyrfz_bhk_rooe[( bvnayyqt ms LafiGeygqpcHdan?ny avtpyt zvklbb;xrzjdxwme}[ hkyumlx. vvxvtvy oqgy sm hpatvoq gz Fyoosuxim yzx mdvbd cxrbf://pmm!mskoug!tzq/ztljjz.d=ybqtgbpw+tbglwgxhfgz+mwncnxa&pyo=4L1GOUJ_ceWB700GO410&yw=bdcbnvyq+puaxcxixkdd+&ubr=ucdfkm.2!70f46p8n224h0!2066q9i4&dthiymxy=wtpipx&tv=GTU-0 evrizg aseil/lwynrbez ytbk cag tribhhdez_llk_rfmh'[ hxnzdxth ql AhiwJefgyklMlls.gg utg: xolky://frfxtgnrntfnx?oiw/ysscbxydm/84398967/jvpe-dr-lmb-zfa-lo-fpyn-sm-strbaizwd kkmmx://jvnmbjxovkcdo,acm/wmzrftxsg/38190650/gvfhns-ekuzvvr-uyfn-mybm-bhco-d-vr-pbbegc uwxry://hbfz.gcscau.xrl/sdlgrorxe/alrlrz-yaz/6737-Vrxdgn/080713!kbob illcf://fdn?ebccdknipqth!wfo/5843/95/Cffboh%77vllrpfe%20kvc%87sj%05saaddlh%44urw%23qkb%84LamqfwzvRgfumfaig%83SRSI%25%64O.bldo
  • Editing lyrics and chords text files

    12
    0 Votes
    12 Posts
    3k Views
    Colin BC

    The transformation between Ultimate-guitar type tab and chord pro is available on this web page. It is a github project

    https://ultimate.ftes.de << looks like a personal web site.

    https://github.com/ftes/ultimate-to-chordpro << looks a bit more permanent.

    Works very well.

  • Synchronzied scrolling with timestamp

    5
    0 Votes
    5 Posts
    499 Views
    Alan KilbornA

    And, for completeness, to go back the other way:

    def custom_replace_func2(m): secs_as_str = m.group(0)[0:10] msecs_as_str = m.group(0)[10:13] secs_as_float = float(secs_as_str) + (float(msecs_as_str) / 1000.0) dt_from_utc_epoch = dt.utcfromtimestamp(secs_as_float) return dt_from_utc_epoch.strftime('%Y/%m/%d %H:%M:%S.%f')[:-3] editor.rereplace(r'^\d{13}(?=A)', custom_replace_func2)

    Will take:

    1674125098362A 1674125099365A 1674125105998A 1674125217380A 1674207312267A 1674207863334A

    and produce:

    2023/01/19 10:44:58.362A 2023/01/19 10:44:59.365A 2023/01/19 10:45:05.998A 2023/01/19 10:46:57.038A 2023/01/20 09:35:12.267A 2023/01/20 09:44:23.334A
  • Help with search and replace regex

    7
    1 Votes
    7 Posts
    689 Views
    Alan KilbornA

    It is good that a solution here helped out the OP, but as I read the problem statement, it struck me that, although sample data was provided, perhaps the larger data set doesn’t always conform to the key parts of the sample. Only the OP knows this (or could know it by looking at more of his data set). People proposing solutions wouldn’t know it, so they may “key off” of some things that aren’t true in the larger data set.

    I guess my basic point is that OP should really look hard at his data set and make sure that the solution chosen really does what is intended for all of the data set. This is somewhat obvious, but it is easy to “grab and go” with a solution, and then find out later that you haven’t covered all cases, or worse, you’ve irretrievably corrupted your data.

    It always seems easier to “trust” someone else’s solution is good for your problem. (Think about “code-grab-and-go” from a stackoverflow solution.) When you’re developing your own solution, you tend to look at things with a closer and more-critical eye.

    Of course, if a problem with the data conversion is noticed down the road, OP could come back here and “complain” that the solution was deficient, to be told that the solution was adequate for the sample data and problem description.

  • New line is not at start of line?!

    3
    0 Votes
    3 Posts
    395 Views
    Autperformance ChrisA

    @Alan-Kilborn had to change the language to english so i could follow your steps and then found the thing - there were 3 options in line wrap: Default, Aligned and Indent - i don’t know why but it was on Indent, changed it to Default and now it works like it was before, thank you very much!

  • Deploy Notepad++ on Teams for text docs

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP

    @MHUnmann ,

    Sorry I misunderstood. I had no idea that Teams could be used to deploy software. I am just an ordinary-to-middling user of Teams, and know nothing about its superpowers.

    If the Teams-based deployment is similar to the Intune-based deployment (I haven’t read the articles you linked to, and know virtually nothing about either), then I’ll say to you something similar to what I said a few minutes ago in another conversation: the regulars here aren’t necessarily experts in things like Intune or Teams administration; however, in this discussion, the user there showed an example script presumably used somehow in Intune to install Noteapad++ and some plugins; that script might be a starting point for you, depending on how similar the Intune and Teams procedures are.

  • Notepad++ intune install

    2
    0 Votes
    2 Posts
    4k Views
    PeterJonesP

    @Sam-Martens ,

    We occasionally get Intune questions here, but I don’t know that any of the regulars has experience on the Intune admin side of things.

    That said, this discussion from a few months ago shows that user’s script for installing plugins. (And also some of the gotchas about directory permissions when you use such a script.) But it might give you a starting point.

  • Trim LDAP extract

    7
    0 Votes
    7 Posts
    1k Views
    Olivier ChantraineO

    @PeterJones said in Trim LDAP extract:

    @Olivier-Chantraine said in Trim LDAP extract:

    and it work well (for marking only)
    but , if i replace, the regex erase all “CN=text,” in the same line

    That’s because after the substitution, the next CN=text, is the first CN=text, on the line, and it will match again.

    I think what you want is
    FIND = (?-s)^CN=.*?,(.*)$
    REPLACE = ${1}

    That will delete the first CN=..., on each line, leaving the rest of the line intact.

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation

    Ty, its working :)

  • how to reopen same file from taskbar without using backup option

    3
    0 Votes
    3 Posts
    357 Views
    Terry RT

    @Shekhar-Singh said in how to reopen same file from taskbar without using backup option:

    how can i reopen the same file by clicking on the icon on the taskbar without using the back up option …

    As Notepad++ (NPP) uses the same configuration settings each time it loads (by default) and the backup settings are stored in these configuration files you cannot achieve what you want (directly).

    However there is a command line argument (see ?, then Command Line Arguments…), look for -settingsDir=. I’ve never used this and have no idea on how well it might work for your need. However if it does it would mean you could specify an alternate set of configuration files for running NPP which have all those backup options turned off (at your risk). It would also mean you would have to create a second icon on the taskbar which has the command line parameters to suit this alternate option.

    Also read the announcement for v7.9.2 here which was when this option was implemented.
    The corresponding github page here has more background information.

    As for your second question, can NPP cause high disk usage? Possibly, if you have a lot of large text files loaded and the backup settings set to a low value (backup every xx seconds).

    I should at this point reference the online manual and the information about backup here
    Also you should read one of the FAQ posts called Periodic Backup vs AutoSave Plugin here.

    There has been much debate over which settings are best, and in the end it really depends on what you prefer and what you can afford to lose if the application (or PC) crashes.

    Terry

  • Community Forum Search Results

    4
    0 Votes
    4 Posts
    250 Views
    JeronymiteJ

    @PeterJones Many thanks, Peter! Should have seen that.

  • New ILexer interface from PythonScript

    10
    2 Votes
    10 Posts
    1k Views
    Michael VincentM

    @rdipardo said in New ILexer interface from PythonScript:

    before the Python host is even ready to execute scripts.

    @Bas-de-Reuver

    Both are correct. However, PythonScript offers enough in the form of API and callbacks that we can access the compiled lexers and by reading in a config file (langs.hidden.xml) and stylers file (stylers.hidden.xml) based on their “.model.xml” versions, we can get pretty decent lexing for “non-standard” languages, including (ones I’ve tried):

    Stata Julia X12 Edifact BibTeX F# Raku

    Thanks to @PeterJones for his code pointer above in this thread which I highly modified to get to this solution.

    PS: If you include the GlobalStyles tag in the “hidden” stylers file, you can actually select it in the Style Configurator and make changes. The changes are not effective immediately, you need to save and then use PythonScript to .reload_lexer(), but the slight inconvenience of 2-step process for the few times I’ll do this … no big deal.

    ab0c1ac8-b248-46fb-9b08-336c6e9b194b-image.png

    Thank you all!

    Cheers.

  • How to have colored and numbered blocks?

    2
    0 Votes
    2 Posts
    341 Views
    PeterJonesP

    @Diego-Giurgola ,

    The colored blocks shown there are the “Change History” feature, which requires v8.4.6 or newer. So those line colors in the margin will change based on which lines have been changed or saved since you started editing the file.

    They are not an “attribute” that you can set, so you cannot say, “in file1.txt, I want lines 1-7 to have a green margin and 8-12 to have an orange margin”, so the feature that you are seeing will not do what I think you want.

  • UDL for .BAT or .CMD files

    2
    0 Votes
    2 Posts
    227 Views
    EkopalypseE

    @Christophe-MERCEY

    Probably not, since there is a built-in lexer.

    language menu:

    0e8bb8bf-0a5c-4dbe-8e6d-fcb0a9f07bb4-image.png

  • Default Find button

    3
    0 Votes
    3 Posts
    403 Views
    Alan KilbornA

    @Amazon-Books said in Default Find button:

    How can I make this “Find All in Current Document” button the default ‘Find’ button instead of “Find Next”?

    You can’t, at least not easily.
    I suppose what you want is to simply press Enter to have FACD happen.
    Suggest take @Lycan-Thrope 's suggestion and retrain yourself to hit Alt+d instead of Enter in this circumstance.