• Extract the lines greater than

    6
    0 Votes
    6 Posts
    2k Views
    Alan KilbornA

    @guy038 said in Extract the lines greater than:

    And I thought that the OP wanted to select the entire lines with last number greater than 14.

    Yes, you thought that because that’s what the OP said. :-)

    May be, the OP just wants to delete lines with last number under 15 !

    I don’t know about that.
    I’ve already queried the OP on what his end goal is.
    Probably best to wait for that answer, if it ever comes.

  • Problems with Notepad++ v7.8.7 windows management icons dissapear

    3
    0 Votes
    3 Posts
    327 Views
    1980Gandalf1

    @PeterJones Hello and thanks Peter.

    Notepad++ DebugInfo.jpg

    “You uninstalled it, but have you rebooted to make sure that all remnants are gone?” Yes I did it because I don’t know why my computer stopped detecting some external hard drives connected through USB and tested in different ports so I finally rebooted.

    Sorry but I realized (I think it could happened the same earlier) that could be a framwework windows border color problem (not windows or notepad++). I changed windows border framework because with dark mode I wasn’t able to see anything when I was managing windows border so I read a article how to geek in how to change it and now, I think that in the first image I can’t see the whole notepad++ window border because program is really top located and blue border is mixed with other program blue border
    Notepad-Problem.jpg

    But now it seems I can see notepad++ blue border mixed with other program blue border but I can see windows management icons
    01 Windows frameworks.jpg

    Sorry first for posting wrong images (this time I used upload image forum option) and secondly I think it could have been a visual effect and not a bug of windows or notepad++, anyway, I will keep checking it to see if I experience it again.

    Thanks a lot for your help @PeterJones

  • Searching two words on different lines

    4
    0 Votes
    4 Posts
    1k Views
    Alan KilbornA

    Like most of @Makwana-Prahlad 's posts, this one deeply confuses me.

    You need a new version of notepad++. Looks like old versions don’t support |.

    Misinformation, unless by “old” you mean pre-6.0.
    But why would you assume OP is using a really old version anyway – the OP didn’t say what version, but…

    egrep

    What does that have to do with anything??

    egrep “CAT|TOWN” will search for lines containing CATOWN.

    What does that have to do what the OP is needing to do?

    I could pick apart the rest of the posting, but it is getting tiring.
    Just please, don’t spread misinformation.

  • How to suceed these actions in notepad++ (images included)

    19
    0 Votes
    19 Posts
    1k Views
    DJSpirosGD

    @guy038 said in How to suceed these actions in notepad++ (images included):

    Thanks for searching on your own ! Your regex is OK if the second line begins with a digit but would not work if the first line would begin with a digit

    I’am trying to learn! Not successfully i guess :-P

    You are right i haven’t thought about the first line, i was focusing on artist because of my example. I don’t say that i could solve it though :-)

    By the way your script works flawlessly

  • Range Comand of Numbers in UDLdidn't work

    2
    0 Votes
    2 Posts
    467 Views
    guy038G

    Hello, @hans-gerch and All,

    The Range field ( Bereich ) is not intended to define the range of numbers

    It’s just a kind of suffix-prefix symbol(s) which will be highlighted, like the numbers placed right before and, possibly, the numbers located right after

    For instance, if that Range zone contains - :: __ ( a single dash, a double colon or a double underscore chars ), this means that, for instance, all the strings, below, will be highlighted in red

    2-0.5 100::47 0.003__7.785 0000::

    Now, I’m not very acquainted with UDL and I don’t see an obvious way to distinguish the digit 0 from the other digits ! I’m afraid that it cannot be do with the native N++ UDL feature.

    However, you could use an enhanced UDL lexer, which could manage, differently, the 0 digit from the others. Two conditions :

    Firstly, install the PythonScript plugin ( last version 1.5.4, using Python v2.7.18 )

    Secondly, use the EnhanceUDLLexer.py Python script, created by @ekopalypse, from that post :

    https://notepad-plus-plus.org/community/topic/17134/enhance-udl-lexer/31

    Best Regards,

    guy038

  • Sort case insensitive on 64 bit?

    17
    0 Votes
    17 Posts
    2k Views
    Alan KilbornA

    @Michael-Vincent @Terry-R

    Hey! Those don’t should like sh!tty names!
    They seem like backronyms to me though. :-)

  • Convert Clock Hours to Double Digits

    3
    0 Votes
    3 Posts
    246 Views
    Sean PerryS

    @guy038 said in Convert Clock Hours to Double Digits:

    \b\d:\d\d([[:punct:]]\d\d([[:punct:]]\d\d)?)?

    You are correct, that did the trick and saved me a lot of time. Thank you!

  • 0 Votes
    2 Posts
    194 Views
    Alan KilbornA

    @Võ-Văn-Hiếu

    I guess because a developer forgot to add it? :-)

    If you want to get it added, you can make a request by following the instructions provided HERE.

    As a workaround, you could record the operation into a macro, and then bind your desired keycombo to that macro.

  • Notepad++ 7.8.7 freeze/whiteout on start

    5
    0 Votes
    5 Posts
    5k Views
    Alan KilbornA

    @brkerez

    Nice analysis!
    It’s a good reminder for everyone in an odd situation: The first thing you should try is disabling all plugins and see what that does for you.

  • Proxy settings

    2
    0 Votes
    2 Posts
    2k Views
    HR HufnStufH

    @HR-HufnStuf

    The answer to this was actually simple. When I connected to our guest network or my personal network at home it worked.

  • Parenthesis (<curved brackets>) won't appear when 'Replacing'.

    8
    1 Votes
    8 Posts
    882 Views
    Alan KilbornA

    @Terry-Gaff-0

    Ah, it didn’t hit me that your macro uses Replace and not Replace All (until I looked up the 1608 in Peter’s link above).

    With Replace you could very well intend to run it twice in succession, in which case those “6 lines” would be duplicated in the recorder data.

    It all depends upon what you are actually doing (which we don’t have a good grasp on). We trust that YOU know what you are doing. :-)

  • adding incremental number between ' '

    2
    0 Votes
    2 Posts
    230 Views
    guy038G

    Hello, @speedrider and All,

    Here is my solution :

    From your text :

    '13': type: SHOP id: SPRUCE_WOOD buy-price: 200.0 '14': type: SHOP id: BIRCH_LOG buy-price: 200.0 '15': type: SHOP id: BIRCH_WOOD buy-price: 200.0 '16': type: SHOP id: JUNGLE_LOG buy-price: 200.0 '17': type: SHOP id: JUNGLE_WOOD buy-price: 200.0 '18': type: SHOP id: ACACIA_LOG buy-price: 200.0 '19': type: SHOP id: ACACIA_WOOD buy-price: 200.0 '20': type: SHOP id: DARK_OAK_LOG buy-price: 200.0 '21': type: SHOP id: DARK_OAK_WOOD buy-price: 200.0 '22': type: SHOP id: SPONGE buy-price: 260.0 '23': type: SHOP id: BRICKS buy-price: 270.0 '24': type: SHOP id: WHITE_WOOL buy-price: 320.0

    Do this regex S/R :

    SEARCH \R(?!\h*')|('\d+')

    REPLACE ?1'':|

    Select the Regular expression search mode

    You should get this text :

    '':| type: SHOP| id: SPRUCE_WOOD| buy-price: 200.0 '':| type: SHOP| id: BIRCH_LOG| buy-price: 200.0 '':| type: SHOP| id: BIRCH_WOOD| buy-price: 200.0 '':| type: SHOP| id: JUNGLE_LOG| buy-price: 200.0 '':| type: SHOP| id: JUNGLE_WOOD| buy-price: 200.0 '':| type: SHOP| id: ACACIA_LOG| buy-price: 200.0 '':| type: SHOP| id: ACACIA_WOOD| buy-price: 200.0 '':| type: SHOP| id: DARK_OAK_LOG| buy-price: 200.0 '':| type: SHOP| id: DARK_OAK_WOOD| buy-price: 200.0 '':| type: SHOP| id: SPONGE| buy-price: 260.0 '':| type: SHOP| id: BRICKS| buy-price: 270.0 '':| type: SHOP| id: WHITE_WOOL| buy-price: 320.0|

    Now place the caret between the first '' zone

    Open the Column editor ( Alt + C ) and renumber as you like

    Don’t forget to tick the Leading zeros option

    For instance, we could end with this text :

    '01':| type: SHOP| id: SPRUCE_WOOD| buy-price: 200.0 '02':| type: SHOP| id: BIRCH_LOG| buy-price: 200.0 '03':| type: SHOP| id: BIRCH_WOOD| buy-price: 200.0 '04':| type: SHOP| id: JUNGLE_LOG| buy-price: 200.0 '05':| type: SHOP| id: JUNGLE_WOOD| buy-price: 200.0 '06':| type: SHOP| id: ACACIA_LOG| buy-price: 200.0 '07':| type: SHOP| id: ACACIA_WOOD| buy-price: 200.0 '08':| type: SHOP| id: DARK_OAK_LOG| buy-price: 200.0 '09':| type: SHOP| id: DARK_OAK_WOOD| buy-price: 200.0 '10':| type: SHOP| id: SPONGE| buy-price: 260.0 '11':| type: SHOP| id: BRICKS| buy-price: 270.0 '12':| type: SHOP| id: WHITE_WOOL| buy-price: 320.0|

    Now, use this simple regex S/R to get your initial list :

    SEARCH \|

    REPLACE \r\n for Windows files    OR    \n for Unix files

    '01': type: SHOP id: SPRUCE_WOOD buy-price: 200.0 '02': type: SHOP id: BIRCH_LOG buy-price: 200.0 '03': type: SHOP id: BIRCH_WOOD buy-price: 200.0 '04': type: SHOP id: JUNGLE_LOG buy-price: 200.0 '05': type: SHOP id: JUNGLE_WOOD buy-price: 200.0 '06': type: SHOP id: ACACIA_LOG buy-price: 200.0 '07': type: SHOP id: ACACIA_WOOD buy-price: 200.0 '08': type: SHOP id: DARK_OAK_LOG buy-price: 200.0 '09': type: SHOP id: DARK_OAK_WOOD buy-price: 200.0 '10': type: SHOP id: SPONGE buy-price: 260.0 '11': type: SHOP id: BRICKS buy-price: 270.0 '12': type: SHOP id: WHITE_WOOL buy-price: 320.0

    Voila !

    Best Regards,

    guy038

  • How to copy or extract particular string value from each line ?

    11
    0 Votes
    11 Posts
    6k Views
    guy038G

    Hi, @ekopalypse, @sagar-kurapati, @alan-kilborn and All,

    @ekopalypse, you’re perfectly right about it ! I’m probably going to add a remark in my previous post !

    Indeed, if I move the caret to a line containing a MD5 signature, without the restrictive condition that it must also contain the string POST/items/update-batch, my regex wrongly matches it :-((

    The problem is that, after moving caret to any position, the regex engine thinks that this location is the very start of the text. It’s a general drawback of the powerful \G behavior !

    Normally, the regex engine always tries, first, the first alternative of regex C, because of the (?-s) modifier and because of line-breaks in text. Indeed, the second alternative is never tried, first, as possible matches cannot be contiguous

    So the 1st part matches, for instance, the string OST/items/update-batch4311bbbeca82649427b192c7b868133c. Then the 2nd alternative \G.+?\K[[:xdigit:]]{32} matches the contiguous area, made of the smallest range of any standard char till an other MD5 signature and so on till the end of current scanned line

    Then, because of the line-break chars, the next match cannot be contiguous, implying, necessarily, that the next match will be satisfied by the first alternative, only !

    A solution would be to :

    Firstly mark all the lines containing the string OST/items/update-batch with a special symbol, ending each line

    Secondly, search for any MD5 signature, ONLY IF current line ends with that special symbol

    Thirdly delete this special symbol, as well

    But, I haven’t found out a fair regex to suppress this drawback, yet !

    To conclude, I think that the only sensible solution is to move the caret to the very beginning of file, which does not match, most of the time, the regex pattern located after the \G syntax ;-))

    Best Regards,

    guy038

  • Can I replace character with linefeedchracater in Notepad++ ?

    7
    0 Votes
    7 Posts
    462 Views
    PeterJonesP

    @PeterJones said in Can I replace character with linefeedchracater in Notepad++ ?:

    Let’s see how it renders after posting…

    baa88330-f1b9-45cf-9976-70e53c601375-image.png

    Looks like \\[ and \\] have special meaning in the forum’s markdown’s backtick implementation. Weird.

  • Totally botched view of an .rtf file

    7
    1 Votes
    7 Posts
    1k Views
    David GalbraithD

    Well, I guess it’s not the Fault of NPP. I even opened it up in Word and removed all formatting and tried again. Didn’t help. I’ll just have to create a new rtf file and copy the text over and then replace all of my copies with the new rtf file. Thanks for being so helpful. :)

  • Hunspell

    6
    0 Votes
    6 Posts
    990 Views
    Thomas 2020T

    I think you are probably going to have to type more than 5-8 words in a posting in order to get your point across.

    The shorter the sentences, the more easily the translator translates.

    Ignored only for current session.
    This means it will reappear the next time it is edited.

    I can’t convert pl_PL.dic to a dictionary and convert again to pl_PL.dic.

  • Delete line with duplicate Number

    6
    0 Votes
    6 Posts
    707 Views
    guy038G

    Hello @jim-erlich and All,

    Sorry for being late ! So, here are, below, some explanations about my regex S/R :

    SEARCH (?-s)^.+#\x20?(\d+)\R(?=.+#\x20?\1)

    REPLACE Leave EMPTY

    First, the (?-s) in-line modifier ensures that any further . regex symbol corresponds to a single standard character, only and not to a line-break char !

    So, the next part ^.+#\x20? searches, from beginning of line ( ^ ), any non-null range of characters ( .+ ), followed by the # symbol and an optional space char (\x20?)

    Then, it looks for a non-null range of digits ( \d+ ), followed by line-break character(s)

    So, the regex engine looks for an entire line ( digits after the # are stored as group 1 as embedded in parentheses ) but ONLY IF the next line ends with the same number !

    This condition can be expressed with a look-ahead structure (?=......) which are rather a user assertion in the same way that, for instance, the $ symbol is a system assertion, looking for the zero length assertion “end of line” !

    So current line must be followed with the regex .+#\x20?\1, which represents, again, a non-null range of standard characters followed with a # and possibly a space char and finally the group 1 ( \1 ) which is the ending number of the current line

    Note that the ^ assertion for the second line, in the look-ahead structure, is useless as the range (.+) comes next the line-break char(s) \R, anyway !

    As the replacement zone is empty, the current line, with its line-break, is just deleted

    For a quick oversight about regular expressions, see the N++ documentation, below :

    https://npp-user-manual.org/docs/searching/#regular-expressions

    See also the main links regarding the Boost regex library, used by the regex N++ engine :

    https://www.boost.org/doc/libs/1_70_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html

    https://www.boost.org/doc/libs/1_70_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html

    Finally, see this FAQ topic about regular expressions :

    https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation

    Best Regards,

    guy038

  • From Notepad++ to SSH, wrong conversion

    3
    0 Votes
    3 Posts
    611 Views
    Michael VincentM

    @Dark-Corner

    My guess is line endings. I’m not at computer to show screenshots, but try your cut and paste from N++ with Windows line endings (CR LF) and then try converting your file in N++ to Unix line endings (LF) and try your cut and paste again. I’m betting one will give you the results you want and the other will give you what you’re experience now (undesired).

    Cheers.

  • Substituting exact letter

    11
    0 Votes
    11 Posts
    1k Views
    guy038G

    Hello, @marcos-liell,

    Oh, my God, I had to remember all this old discussion !

    You said :

    when replacing the chord it changes places because of the <b> tag they go forward, would there be a way to move 3 spaces to the left when replacing?

    It’s not very clear to me ! So, would you mind showing :

    An example of your initial text

    Which search and replacement regexes did you use

    The resulting text that you obtained

    And the text that you would expect to !

    Thanks !

    Best Regards,

    guy038

  • How to find/replace a character in every specific line

    3
    0 Votes
    3 Posts
    4k Views
    guy038G

    Hello, @johnny27 and All,

    Interesting problem ! And easy to solve with, both, regular expressions and the Column Editor ;-))

    Here is the road map :

    Open your file in Notepad++

    Place th caret at the very beginning of the first line

    Open the Column Editor ( Alt + C )

    Select Number to Insert

    Type in 1 in all zones

    Tick the Leading zeros option ( IMPORTANT )

    Select the Dec format, if necessary

    Click on the OK button

    => Each line should be preceded with a 6 digits number !

    Now, open the Replace dialog ( Ctrl + H )

    SEARCH (?-s)^.[50]0000(.+),|^\d{6}

    REPLACE ?1\1;

    Tick the Wrap around option

    Select the Regular expression search mode

    Click on the Replace All button

    Voila ! Nice isn’t it ?

    Notes :

    The search regex contains two alternatives :

    First, the (?-s) in-line modifier ensures that any . regex symbol corresponds to a single standard character, only and not to a line-break char !

    Then the part ^.[50]0000 searches for any number of six digits, beginning current line and containing a 0 or a 5 at second position, followed with four 0 digits

    And the part (.+), looks for theremainder of the lines, minus the , character, which is stored as group 1, due to the parentheses

    If current line number is not of the form ^.[50]0000, then it, necessarily, matches the second alternative :

    The part ^\d{6} matches the 6 digits number, generated by the Column Editor, which begins any line

    The replacement regex contains a conditional replacement (?#....:....) :

    If group 1 exists ( every 50,000 lines ), we rewrites the group 1, followed with a semi-colon

    If group 1 is absent, as the negative part, after a : does not exist, the first 6 digits number of any line are simply deleted

    Best Regards,

    guy038