• Opening A Batch File In Notepad++ In The Folder Where Notepad++ Is Opened

    4
    0 Votes
    4 Posts
    2k Views
    EkopalypseE

    @Garvit-Joshi

    Do you know NppExec plugin?
    Maybe worth to have a look.

  • Add new lines after matching lines (was:'Hello ALL')

    11
    0 Votes
    11 Posts
    591 Views
    Rajeev GuptaR

    @PeterJones said in Add new lines after matching lines (was:'Hello ALL'):

    (?-s)set @queryName = '(.)';\h(?:(\R)|\z)\K

    Hi PeterJones – Thanks a lot for your valuable time, your solution working successfully, I am new here but it’s quite interesting to learn regex.

    :) Thanks you Sir

  • trying to delet a bunch of lines

    4
    0 Votes
    4 Posts
    252 Views
    guy038G

    Hi, @alan-kilborn and All,

    Indeed, as noticed, below, in the Special characters section :

    https://www.regular-expressions.info/characters.html

    There are only 12 special regex characters and, both, the closing square bracket ] and the closing curly bracket } are not part of this set !

    Cheers,

    guy038

  • 0 Votes
    5 Posts
    345 Views
    Alan KilbornA

    @guy038

    Nice solution that really looked at solving the OP’s problem, rather than (like me) focusing on “Copy all the results from the Find window” not being macro-recordable.

  • Code Folding - how to show vertical line?

    3
    0 Votes
    3 Posts
    248 Views
    Ninon_1977N

    Hi :-)

    Thank you for your response!
    I use UDL - and after some trouble shooting I found the solution/reason for this behaviour.
    Above the text of my screenshot I had a comment called:

    "MSTART
    .
    .
    .
    MEND

    So the folding was closed but never opened.
    After I deleted the quotes before MSTART it worked.

    BG,
    Heike

  • File Cannot Be Saved and it May Be Protected

    2
    0 Votes
    2 Posts
    473 Views
    PeterJonesP

    @Rachael-Murphy ,

    I am sorry you are having difficulty.

    Unfortunately, you haven’t given us much to work with. Notepad++ can save a file that’s been opened by a browser: I just opened a file in Chrome, then changed the file in Notepad++, saved the changes, refreshed Chrome, and Chrome saw the updated file.

    That means, if you want help, you are going to have to give us more details about your version of Notepad++, where the files are stored, and the exact series of events that lead to the problem. The FAQ I linked explains how to grab some useful debug info about Notepad++, and gives hints as to other possibly-pertinent information you should include in your reply. (The FAQ was written with an old version of the Community Forum. Now, if you want to include a screenshot – like say, of the error message – all you have to do is Alt+PrintScreen the dialog, then Ctrl+V to paste it in your reply.)

  • Remove entries from second file

    12
    0 Votes
    12 Posts
    2k Views
    guy038G

    Hello, @terry-r and All,

    I said :

    I was waiting the Terry’s reply, first,…

    Because I think it is more fair to let the first guy, helping the OP, to develop his solution ;-)) Then, you can jump into the discussion, proposing alternate solutions, too !

    Besides, I know that I’m really too eager to give my regex solutions and, very often, I must prevent some people from helping their own solutions ;-))

    Now, regarding your solution, you’re right about it : best to avoid large amounts of data inside the look-ahead structure ;-))

    So, from the short example data, given in my previous post :

    one two three four five six seven eight nine ten twenty-two %%%%%%%%%% twenty-two five nineteen seven

    First, using the Edit > Column Editor... option, at column 12 or more, we would get :

    one 01 two 02 three 03 four 04 five 05 six 06 seven 07 eight 08 nine 09 ten 10 twenty-two 11 %%%%%%%%%% 12 twenty-two 13 five 14 nineteen 15 seven 16

    And , after the Edit > Line Operations > Sort Lines Lexicographically Ascending option, we have :

    %%%%%%%%%% 12 eight 08 five 05 five 14 four 04 nine 09 nineteen 15 one 01 seven 07 seven 16 six 06 ten 10 three 03 twenty-two 11 twenty-two 13 two 02

    Now, using the following regex S/R :

    SEARCH (?-s)^(.+)\x20+\d+\R\1\x20+\d+\R? OR (?-s)^(.+)(\x20+\d+\R?)\1(?2)

    REPLACE Leave EMPTY

    We are left with :

    %%%%%%%%%% 12 eight 08 four 04 nine 09 nineteen 15 one 01 six 06 ten 10 three 03 two 02

    Then, moving back the numbers from the end to the beginning of line and adding a space column, with the column mode selection, we would obtain :

    12 %%%%%%%%%% 08 eight 04 four 09 nine 15 nineteen 01 one 06 six 10 ten 03 three 02 two

    And, after a last ascending sort, we have :

    01 one 02 two 03 three 04 four 06 six 08 eight 09 nine 10 ten 12 %%%%%%%%%% 15 nineteen

    Finally, after processing this last regex S/R, we get our expected text, removing leading numbers and trailing spaces as well as anything from the separation line till the very end of file :

    SEARCH (?s)^\d+\h*%%%+.+|^\d+\h*|\h+$

    REPLACE Leave EMPTY

    one two three four six eight nine ten

    Cheers,

    guy038

  • Shuffle text lines

    2
    0 Votes
    2 Posts
    1k Views
    Terry RT

    @Michael-Weet said in Shuffle text lines:

    shuffle text lines

    Welcome to the NPP forum. I first have to say your sentence “nicely sort lines ascending or descending” contradicts the request to “shuffle” especially when the link refers to a random sort.

    You should be aware that an ascending or descending sort can easily be done with “Line Operations” which is under the “Edit” menu. However random sorts aren’t possible in NPP without additional help from plugins or one of the supporting programming languages.

    Might I suggest you read the posts:
    https://community.notepad-plus-plus.org/topic/16318/sorting-lines-evenly-in-document
    as that might give you some direction.

    As a very rough simile to “randomness” considering grabbing 2 characters at different positions within each line, copying these to the start of the line, then sorting. Then those characters could be removed, thus leaving a “sort-of” random ordering of the lines.

    Terry

  • user-defined syntax highlighting

    5
    1 Votes
    5 Posts
    402 Views
    Ninon_1977N

    Thank you!
    It works when I define operator 1 as follows: -.
    :-)

    BG,
    Heike

  • File Association gave me more than I bargained for

    8
    1 Votes
    8 Posts
    405 Views
    EkopalypseE

    @Alan-Kilborn
    found some discussion from the community.
    I still haven’t found the problem, maybe it was the linked post
    I mistakenly thought was reported as a problem.

  • Patching?

    2
    0 Votes
    2 Posts
    168 Views
    EkopalypseE

    Notepad++ is an standalone Win32 application. No client/server concept.
    The application itself does get updated whenever Don, the author of npp,
    sees a need to do so.

  • CSV file first field check

    12
    0 Votes
    12 Posts
    517 Views
    SofistanppS

    Hi @Wally-Kempf

    Maybe I’m assuming too much, but if you want to get rid of those false line wraps, extend @Alan-Kilborn 's regex as follows:

    Search: (?s)(\R)(?!"\d{6}",) Replace: \x20

    which produces this two-lines outcome:

    "040339","0006","013","Amherst at City View","","","","","","HOUSTON","TX","77060","17103 IMPERIAL VALLEY DR","227","75.00","8.000000","AI","gate code 2070","","1","","","","","","","","29.946850","-95.396846","1.00","","","174350" "041217","0001","001","PALM BEACH ESTATES ","","","","","","HOUSTON","TX","77060","16818 CITY VIEW PL","227","76.00","8.000000","AI","GATE CODE 1454 SECTION 1 GATE CODE 1453 ACROSS THE STREET ENTRANCE IS ON CITY VIEW OFF BENMAR","","1","","","","","","","","29.934018","-95.396125","1.00","","","174325"

    Best Regards.

  • Notepad++ Run a Batch File From Current Directory

    14
    1 Votes
    14 Posts
    3k Views
    PeterJonesP

    I will try this and will surely tell you if it worked

    It wasn’t so much a “worked” as “we need to see what Notepad++ is sending to the command processor to figure out what’s going wrong”.

    But with the bit of information, it’s irrelevant now:

    I used %cd% to go to the directory… but cd /d "%~dp0" should be used in case of opening batch file

    Yes, the /d makes sense. I tend to forget that changing directory and drive using cd is more difficult; I primarily use single-drive systems (well, at work, we have network drives mapped to letters, but I’m almost never cd-ing into those directories)

    The %~dp0 changes the batch/script name to just be a drive and folder… but since in the NotepadPlusPlus user-commands, you don’t have a batch/script filename, and $(CURRENT_DIRECTORY) already gives what you want (just the drive and folder), you don’t need that part.

    So, the command you need is

    <Command name="Java_Executor" Ctrl="no" Alt="no" Shift="no" Key="0">cmd /k cd /d &quot;$(CURRENT_DIRECTORY)&quot; &amp;&amp; &quot;D:\Projects\Java\Executor_Java.bat&quot;</Command>

    Note: I also put quotes around $(CURRENT_DIRECTORY) as well, in case it has spaces in the path.

    BTW: Thanks for linking to the SO thread; when asking a question in multiple forums, it’s polite to crosslink both right away, so people can see whether it’s already been answered in the other location, or can learn from the other community’s responses.

  • Search line without ending tag

    8
    1 Votes
    8 Posts
    792 Views
  • eseguire il lavoro

    16
    0 Votes
    16 Posts
    1k Views
    Umberto CapuanoU

    Now I have another problem no matter how much you save the file in html on the browser where I run it exit the scripts without letting me see the content (sorry for English)

  • Notepad ++ update

    2
    0 Votes
    2 Posts
    196 Views
    EkopalypseE

    @godavari-gupta

    what about disabling this setting

    3aaf6592-047d-49e7-81fd-fc4a7179021c-image.png

  • Can I style a code starting with $ and ending with a space?

    3
    0 Votes
    3 Posts
    228 Views
    EkopalypseE

    Perhaps also a standard UDL (User Defined Language) can help in your case; this would also make the styling permanent.

    Yes, use $ as a keyword and check prefix box.
    Will color everything starting from $ til first non-word-char.

  • Notepad++ macro not working correctly

    5
    1 Votes
    5 Posts
    5k Views
    guy038G

    Hello, @tarek-faham,

    I’m a bit surprised because this kind of replacement is quite easy to process, even in normal search mode !

    SEARCH ""

    REPLACE "

    giving the new macro :

    <Macro name='UnEscape &quot;&quot; to &quot;' Ctrl="no" Alt="no" Shift="no" Key="0"> <!-- Macro NAME & possible SHORTCUT --> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <!-- Initialization S/R --> <Action type="3" message="1601" wParam="0" lParam="0" sParam='&quot;&quot;' /> <!-- SEARCH "" --> <Action type="3" message="1625" wParam="0" lParam="0" sParam="" /> <!-- NORMAL search mode --> <Action type="3" message="1602" wParam="0" lParam="0" sParam='&quot;' /> <!-- REPLACE " --> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <!-- or 512, if NO Wrap-around --> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <!-- Replace All, in CURRENT file --> </Macro>

    Best Regards,

    guy038

  • how remove only number in notpad++

    3
    0 Votes
    3 Posts
    2k Views
    guy038G

    Hello, @the-best-of-voice and *All,

    Open the Replace dialog ( Ctrl + H )

    SEARCH ^\h*\d+\h*\R

    REPLACE Leave EMPTY

    Tick the Wrap around option, if all the file must be processed and untick this option if the replacement must occur from current location till the very end of file, only

    Select the Regular expression search mode

    Click on the Replace All button

    Notes :

    From beginning of line ( ^ ), it matches possible horizontal blank characters, as Space, Tabulation ( \h* )

    Followed with a non-null range of digits (\d+ )

    Followed with possible horizontal blank characters, again ( \h* )

    And ended with its EOL chars ( \r\n for Windows files, \n in Unix files or \r in Mac files )

    As replacement zone is EMPTY, the entire line, containing digits, only, with possible blank chars, is then deleted

    Best Regards,

    guy038

  • Replace all spaces with a dash (-) but with a certain limit !

    9
    0 Votes
    9 Posts
    1k Views
    Antoine GautierA

    this lesson is well understood :)

    I’m an amateur in website creation, and I have several pages under different names, that I have to put dashes (-) instead of Space and at the end of each line before the / I’ll add extension .html and the rest after (/) is the title of each page.