• How do I delete a line with a certain number in it

    10
    0 Votes
    10 Posts
    396 Views
    Terry RT

    @Squirtleshell said in How do I delete a line with a certain number in it:

    How would I keep the $100.0 and 100.0%

    Assuming everything is on separate lines then you can use the bookmark feature. This is available under the main menu option “Search”, then look for “Mark”.
    In the field just type 100\.0 (assuming search mode is regular expression, otherwise just 100.0 under “Normal” search mode as the . character has special meaning). So one mark operation with the “bookmark” option ticked will find both the $ and the % lines.
    Once the lines have been marked you should see a character at the start of each line marked, usually a blue circle. Now you can remove the non marked lines by using “Search”, “Bookmark” and then “Remove Unmarked Lines”.
    That completes the solution to your first problem.

    As the the second question, how to keep only the code at the start of each remaining line, this I’d do with a regular expression.
    So using the Replace function (as has been shown before) we have
    Find What:(?-s)^(\d+).+
    Replace With:\1
    Make sure “regular expression” selected for search mode, wrap around should be ticked. Click on the “Replace All” button.

    Terry

  • adding html formatting shortcuts (ctrl b for bold, ctrl i for em, etc.)

    3
    0 Votes
    3 Posts
    2k Views
    astrosofistaA

    @Kenneth-LaVoie said in adding html formatting shortcuts (ctrl b for bold, ctrl i for em, etc.):

    I want to be able to highlight a word and hit “control b” and have it put <strong>highlighted word</strong>

    Hi @Kenneth-LaVoie:

    In addition to the good advice from @Ekopalypse, you can also get what you want through a macro, to which a command can be assigned.

    See details in this thread: Update on option to <bold>selection</bold>?

  • Los saved file

    2
    0 Votes
    2 Posts
    114 Views
    EkopalypseE

    @akancha-poddar

    If it was saved, it should be available on the hard disk, right?
    If it was not saved, then depending on your installation,
    you may have the latest version in the backup directory.

  • Where does "Split Lines" actually split?

    4
    0 Votes
    4 Posts
    593 Views
    PeterJonesP

    @freeSeeker said in Where does "Split Lines" actually split?:

    Should I document that in the discussion thread?

    Yes, adding your experience to the bug report would help.

  • Create REN Batch File?

    4
    0 Votes
    4 Posts
    459 Views
    Ron BallR

    @guy038 This is awesome! Thank you so much! It worked perfectly.

  • RegEx command to delete string with variable numbers

    9
    0 Votes
    9 Posts
    503 Views
    Paul smithersP

    Hello, first of all thanks everyone for the help.

    I have tried the first proposal (?:/CreationDate|/M)(D:\d{14}+02’00’) from @Alan-kilborn and it works perfectly since i dont need the \x20 space char.

    For some reason if i use the other proposals, Acrobat refuse to import the modified fdf file because an unspecified error.

    Anyway, i resolved my problem now. I use this script to remove the autor name https://adobe.ly/3emVRkC and the search RegEx for the timestamp.

    Thanks again.

  • 0 Votes
    17 Posts
    2k Views
    Atelier TraductionA

    Thank you @donho, @guy038 and @Alan-Kilborn ;)

  • 0 Votes
    17 Posts
    11k Views
    guy038G

    Hi, @manoharreddyporeddy, and All,

    Continuation of the previous post !

    Now, we must determinate all the levels of these relative paths, found in a specific text. In other words, how many ../ syntaxes exist !

    We’ll use easy regexes, below, and simply click on the Count button, in the Find dialog

    •----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------• | ST | SEARCH | REPLACEMENT | COMMENTS | NUMBER | •----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------• | | \((\.\./){4,}\w | | 0 zone (../../../ /../xxxx/xxxx/xxxxxxx) | 0 Occurrence | | | | | | | | | \((\.\./){3}\w | | 16 zones (../../../xxxx/xxxxxxxx) => Future use of QAUNTIFIER {3} | 16 Occurrences | | | | | | | | 14 | \((\.\./){2}\w | | 0 zone (../../xxxx/xxxx/xxxxxx) => | 0 Occurrence | | | | | | | | | \((\.\./){1}\w | | 6 zones (../xxxx/xxxx/xxxxxxxxx) => Future use of QAUNTIFIER {1} | 6 Occurrences | | | | | | | | | \.md\(\w | | 33 zones (xxxx/xxxx/xxxxxxxxxxxx) => Future use of QAUNTIFIER {0} | 33 Occurrences | •----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•

    From the table, above, we deduce that, in your text, only relative paths beginning with (../../../ or (../ and, of course, some without any part ../, occur

    So, we’re going to reconstitute all the absolute paths, in reverse order. That is to say, beginning with relative paths containing (../../../xxxx/yyyy/zzzz/name.ext, then with (../xxxx/yyyy/zzzz/name.ext and, finally, simple forms (xxxx/yyyy/zzzz/name.ext

    The number of sections ../ are indicated in the quantifier {#}, at two locations for each regex

    Note that each regex dot char ( . ), below, has been replaced with the [^()[] syntax, which represents any single char, different from any parenthesis character ( and ) and from an opening square bracket [. Indeed, one must plan the possibility of several links in a single line and/or possible other block(s) of parentheses, eventually nested !

    •----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------• | ST | SEARCH | REPLACEMENT | COMMENTS | NUMBER | •----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------• | 15 | (?-si)\](http[^()[]+/)([^()[]+?/){3}[^()[]*\((\.\./){3}([^()[]+)\) | ]\x20\(\x20\1\4\x20\) | RELATIVE links (../../../xxxx/xxxxx) are changed as ABSOLUTE links | 16 Occurrences | | | | | | | | 16 | (?-si)\](http[^()[]+/)([^()[]+?/){2}[^()[]*\((\.\./){2}([^()[]+)\) | ]\x20\(\x20\1\4\x20\) | RELATIVE links (../../xxxxx/xxxxxxx) are changed as ABSOLUTE links | 0 Occurrence | | | | | | | | 17 | (?-si)\](http[^()[]+/)([^()[]+?/){1}[^()[]*\((\.\./){1}([^()[]+)\) | ]\x20\(\x20\1\4\x20\) | RELATIVE links (../xxxx/xxxx/xxxxxx) are changed as ABSOLUTE links | 6 Occurrences | | | | | | | | 18 | (?-si)\](http[^()[]+/)([^()[]+?/){0}[^()[]*\((\.\./){0}([^()[]+)\) | ]\x20\(\x20\1\4\x20\) | RELATIVE links (xxxx/xxxx/xxxxxxxxx) are changed as ABSOLUTE links | 33 Occurrences | •----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•

    Finally, if occurrences were found, at step 10, we slightly modify the output of the composite links [![.....] ( ..... )] ( ..... ), again, for readability :

    •----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------• | ST | SEARCH | REPLACEMENT | COMMENTS | NUMBER | •----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------• | 19 | (?-si)\[(!\[.+?]\x20\(\x20http.+?\))\] | \1\x20- | CHANGE [![....] ( .... )] ( .... ) as ![....] ( .... ) - ( .... ) | 0 Occurrence | •----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•

    To end, some simple tasks remain to do :

    You may need to remove or add a few blank lines for a better presentation

    You may delete all trailing blank characters

    In few cases, some numbered markdown lists are still shown as :

    1. bla blah 1. bla blah 1. bla blah

    Simply, renumber these lines, as usual :

    1. bla blah 2. bla blah 3. bla blah

    So, in order to recapitulate the links’s management :

    The syntax [Text](Absolute address) has been changed into [Text] ( Absolute address )

    The syntax ![Text](Address to xxxxx.png) has been changed into ![Text] ( Absolute address to xxxxx.png )

    The syntax [Text](Address to xxxxx.md) has been changed into [Text] ( Absolute Address to xxxxx.md )

    The syntax [![Text](Address to xxxx.png)](Address to xxxxx.md) has been changed into [Text] ( Absolute address to xxxxx.png ) - ( Absolute address to xxxxx.md )

    The syntax [!INCLUDE [Text](Address to xxxxx.md)] has been changed into [INCLUDE] ( Absolute address to xxxxx.md )

    IMPORTANT :

    I preferred to keep the alternate text of the links between square brackets for readability => [alternate text]

    Note that all the links, related to a picture, have an ! symbol before the alternate text

    I also kept all the absolute paths between parentheses, separated from the [alternate text] part by one space character

    However, after tests, I realized that in order that a link, between parentheses, is fully functional, you must surround the address with space chars. So, the final syntax used is ( https://....../name.ext )

    All links are functional but the two links, beginning with (/xxx, at lines 43 and 271 of the initial text

    May be, these links, below, about Markdown syntax, could be valuable :

    On GitHub

    https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax

    https://github.github.com/gfm/

    On Window Azure

    https://github.com/Huachao/azure-content/blob/master/contributor-guide/custom-markdown-extensions.md

    Best Regards,

    guy038

    P.S. : I also tested the raw pages, from these two links. This helped me to identify some special cases ;-))

    https://github.com/MicrosoftDocs/azure-devops-docs/blob/master/docs/organizations/settings/show-bugs-on-backlog.md

    https://github.com/MicrosoftDocs/azure-devops-docs/blob/master/docs/organizations/settings/work/customize-process.md

  • how-to-change-date-format-from-from-mm-dd-YYYY -to-dd-mm-YYYY

    14
    1 Votes
    14 Posts
    4k Views
    Lorenzo AtomL

    @Ekopalypse said in how-to-change-date-format-from-from-mm-dd-YYYY -to-dd-mm-YYYY:

    $2, $3 and $1 refer to the respective groups
    captured by (\d{4})/(\d{1,2})/(\d{1,2})
    The () is what makes a group, so $1
    refers to what has matched by (\d{4}), $2 the next
    group and $3 the last group.
    Rearrange the $X in $2/$3/$1 and you will see how it will change.

    Was REALLY a pleasure… thanks really …REALLY Appreciate!

  • Start new line indented

    3
    0 Votes
    3 Posts
    594 Views
    Ken BohlK

    Thank you!

  • How to change the color of the toolbar in Notepad ++?

    18
    0 Votes
    18 Posts
    2k Views
    Oreshek qqO

    All people are different)
    Thank you, goodbye

  • NEW Language Req: HL7 reader???

    8
    0 Votes
    8 Posts
    3k Views
    Michael VincentM

    @Michael-Vincent said in NEW Language Req: HL7 reader???:

    I can’t seem to find a code repository for the Notepad++ plugin, but here is his Github with other work

    @alarose20

    Looks like hes’ been on this community:
    https://community.notepad-plus-plus.org/user/grahame-grieve

    but not since 2018.

    Cheers.

  • how to make baidu wifi in win7

    1
    -3 Votes
    1 Posts
    101 Views
    No one has replied
  • Adding color picker plugin

    3
    0 Votes
    3 Posts
    867 Views
    Alan KilbornA

    @Dron said in Adding color picker plugin:

    i tried all steps i see on google to do it

    What are the dates on the steps?
    Probably a bit ago.

    Notepad++ has changed.
    You now need to put a plugin in a folder with its same name:
    e.g.
    ...\plugins\XXX\XXX.dll

    Or better yet, use Plugins Admin
    NOT Plugin Manager as you are likely to see in dated internet posts.

  • Help with generating clickable links or something of that sort

    17
    0 Votes
    17 Posts
    610 Views
    EkopalypseE

    @jakima

    Yes, it must start with <space><space>File<space>" to be identified as an “linkeable” string
    and then it reads the rest of that line to see what kind of informations are available.

  • HELP! Replace spaces in text ONLY between quotes?

    15
    0 Votes
    15 Posts
    4k Views
    guy038G

    Hi, @alan-kilobrn and All,

    Well, here it is ! I found a regex structure and some variants, which do the trick very nicely ;-))

    Let’s define these 4 variables :

    Srch_Expr = Char|String|Regex

    Repl_Text = Char|String|Regex

    Opn_Del = Char

    End_Del = Char

    Then the Search_Replacement_A, which matches any Srch_Expr, ONLY WHEN located between the Opn_Del and the End_Del delimiter(s), is :

    SEARCH Srch_Expr(?=[^Opn_Del]*?End_Del)

    REPLACE Repl_Text

    Rules and Remarks :

    The Opn_Del and End_Del delimiters represent, both, a single char, which may be :

    Characters already present of the current file

    Characters presently absent in current file and manually added by the user ( Verify with the Count feature they are new chars ! )

    In case, of added delimiters, use, preferably, the Search_Replacement_B, below, which deletes these temporary delimiters, at the same time :

    SEARCH Opn_Del|(Srch_Expr)(?=[^Opn_Del]*?End_Del)|End_Del

    REPLACE ?1Repl_Text

    The Opn_Del and End_Del delimiters must not be identical. If NOT ( usually, cases "...." or '....' ), perform the following regex S/R, first :

    SEARCH Delim(.+?)Delim

    REPLACE Opn_Del\1End_Del

    Then, execute the Search_Replacement_C, which rewrites, as well, the initial double delimiters Delim :

    SEARCH Opn_Del|(Srch_Expr)(?=[^Opn_Del]*?End_Del)|End_Del

    REPLACE ?1Repl_Text:Delim

    In case that the last zone Opn_Del......End_Del ends at the very end of current file, the End_Del delimiter, of the last zone, can be omitted and you’ll use the Search_Replacement_D, below :

    SEARCH Srch_Expr(?=[^Opn_Del]*?(End_Del|\z))

    REPLACE Repl_Text

    The different zones, between delimiters, must be complete, with their matched different delimiters ( Open_Del......End_Del )

    The different zones, between delimiters, may be juxtaposed but NOT nested

    A zone can lie in a single line or split over several lines

    Srch_Expr must not match the Opn_Del delimiter, or part of it

    As an example, let’s use the license.txt file and define :

    Opn_Del &

    End_Del #

    Srch_Expr \w+

    I previously verified that, both, these two symbols do not exist in the license.txt file

    Place one or several zones &......#, anywhere in this file. The zones may be split on several lines, with the OplDel & in a line and an End_Del # on a further line

    So, the appropriate search regex_A is :

    SEARCH \w+(?=[^&]*?#)

    And imagine that we want to surround any word with strings [-- and --], in zones &............#, ONLY. Hence, the replace Regex_A is :

    REPLACE [--$0--]

    With the same delimiters, let’s suppose that we want, this time, to find any single standard char, so the regex (?-s). and to replace it with an underscore _ char

    However, regarding the rules above, this regex should not match the Opn_Del delimiter. This can be achieved with the regex (?-s)(?!&)., giving the following Search_Replacement_A :

    SEARCH (?-s)(?!&).(?=[^&]*?#)

    REPLACE _

    Now, Alan I also found a regex which works when delimiters are simple words as for instance, STT and END and not single characters :

    Regex_E = Srch_Expr(?=(?s-i:(?:(?!Opn_Del).)*?End_Del))

    Unfortunately, due to the negative look-ahead syntax, (?!Opn_Del).), this regex bugges, even with the light license.txt file :-(( You know : the final wrong “all contents” match ! But it works nice when few lines are involved !

    The safe solution, in that case, is to replace word delimiters with char delimiters, first ( for instance STT -> & and END -> # )

    Finally, a possible @mugsys-rapSheet’s solution, much shorter, using the generic Search_Replacement_C, could be :

    SEARCH &|(\x20)(?=[^&]*?#)|#

    REPLACE ?1_:"

    Of course, assuming this text :

    & C:\xxx\name with spaces.txt #

    Then, the leading and trailing spaces, around the absolute paths, would not be deleted anymore but just replaced with _ characters. Thus, the final text would be :

    "____C:\xxx\name_with_spaces.txt____"

    Best regards,

    guy038

  • I need to find the lines which is having three ; in notepad ++

    5
    1 Votes
    5 Posts
    965 Views
    guy038G

    Hello, @bhogesh-waraprasad, @peterjones, @alan-kilborn and All,

    From this discussion, after some tests, here is an other generic regex which selects all the contents of all lines containing, exactly, N to M times, the Char character, per line :

    ^([^Char\r\n]*)(Char(?1)){N,M}$    or    ^([^Char\r\n]*)(Char(?1)){N}\R if you want to match their line-breaks, too

    So, you can, either, mark, delete or replace these lines ;-))

    Notes :

    Char represents a single character, which is, usually, a non-word character ( A punctuation or symbol char )

    N and M must be replaced with the appropriate integers ( For instance {2,4}, {5,}, {0,3}, {2} or even {0} )

    So the search regex OP is ^([^;\r\n]*)(;(?1)){3}$

    Best Regards,

    guy038

  • Copying highlighted text lines from 1 Notepad++ file to another

    22
    0 Votes
    22 Posts
    3k Views
    Alan KilbornA

    @Alan-Kilborn said in Copying highlighted text lines from 1 Notepad++ file to another:

    …how to bind a keycombo to it to execute the script that way (which is better than menuing for an often-used script).

    Some instructions for that are found in THIS POSTING.

  • 0 Votes
    2 Posts
    327 Views
    PeterJonesP

    @John-Slee ,

    Use the ? modifier to make an element of your regex less greedy (“find the shortest”).

    Good luck.

    ----

    Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as plain text using the </> toolbar button or manual Markdown syntax. Screenshots can be pasted from the clipboard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get… Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.

    -----
    I invoked the “Dail Critereon” for my answer

  • Search and relace - how to put in a line break?

    11
    0 Votes
    11 Posts
    461 Views
    EkopalypseE

    Should we create a cheat sheet :-D