• im new at notepad++ need help please

    Locked
    7
    0 Votes
    7 Posts
    924 Views
    SinghRajenMS

    @andrecool-68 said:

    @Meta-Chuh
    Plant it horizontally))

    Super… nO cONFUSION aT aLL. :P

  • 0 Votes
    2 Posts
    406 Views
    Alan KilbornA

    @Michael-Pollard

    It sounds like a problem, surely. But for what you are trying to accomplish, have you considered

    right clicking a tab and choosing Move to Other View (then you will have 2 editing windows that you can visually compare the contents of 2 files in, right in one instance of Notepad++)

    using the Compare plugin

  • Delete last words after : at the end of each line

    Locked
    5
    0 Votes
    5 Posts
    5k Views
    guy038G

    Hello @vinc-cser, @Peterjones, and All,

    Peter, you beat me to it by a few minutes ;-)). I was thinking about these two solutions :

    SEARCH (?-s)^(.+):.+

    REPLACE \1

    OR :

    SEARCH :[^:\r\n]+$

    REPLACE Leave EMPTY

    Note that your solution :[^:]*$ does not work well when next line(s) does not contain any colon. For instance :

    happylion3872:PIFMYJD8:9kjrgmdsjf4vxlc1dkc791fsd7f878 happylion3872:PIFMYJD8:9kjrgmdsjf4vxlc1dkc791fsd7f878 Some text to see the problem happylion3872:PIFMYJD8:9kjrgmdsjf4vxlc1dkc791fsd7f878

    So, to prevent grabbing multiple lines , use either :

    My second solution :[^:\r\n]+$ , which does not accept End of line chars before an end of line

    Your solution, slightly modified, :[^:]*?$ , which looks for the nearest “end of line”  location !

    @vinc-cser, beware that running twice, any of these regex S/R, would delete the part :PIFMYJD8, as well !

    Best Regards

    guy038

  • Pixel-wise instead of line-wise scrolling possible?

    Locked
    6
    0 Votes
    6 Posts
    2k Views
    bolandrossB

    @PeterJones
    Thank you very much, I’ll look into that.

  • UDL Comment Folding

    Locked
    4
    0 Votes
    4 Posts
    835 Views
    Felix TF

    Thanks so far and also for helping with the encoding.
    I forgot to mention that regular lines can also be encoded using keywords and a dollar: $Time, $File. So a lone opening $ is not working.

  • Using Regex for special search and replace

    Locked
    2
    1 Votes
    2 Posts
    558 Views
    Meta ChuhM

    hola y bienvenido a la notepad++ community, @Jorge-García-López

    yes this is possible.

    find what: ~(.*?)~
    replace with: \\textbf{$1}
    search mode: regular expression
    wrap around: enabled

    then hit replace all

    this will change this text:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. ~Praesent~ condimentum, ligula et egestas pretium, magna nunc tincidunt mauris, at fermentum ~massa~ enim ut mi. Ut ac faucibus lacus. Donec vel est ~et~ justo posuere vulputate. Donec viverra id neque eget vehicula. Donec luctus pharetra odio vitae fringilla. Integer dictum hendrerit congue. ~Pellentesque~ maximus fermentum nulla sed pulvinar. Nulla nisi lorem, interdum ~non~ sagittis nec, posuere a massa. ~Sed~ vitae ex ac ~eros~ dapibus iaculis. Sed ~sit~ amet augue eu justo ultricies facilisis. Pellentesque rhoncus ipsum ligula, at rhoncus mi sollicitudin in.

    to this:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. \textbf{Praesent} condimentum, ligula et egestas pretium, magna nunc tincidunt mauris, at fermentum \textbf{massa} enim ut mi. Ut ac faucibus lacus. Donec vel est \textbf{et} justo posuere vulputate. Donec viverra id neque eget vehicula. Donec luctus pharetra odio vitae fringilla. Integer dictum hendrerit congue. \textbf{Pellentesque} maximus fermentum nulla sed pulvinar. Nulla nisi lorem, interdum \textbf{non} sagittis nec, posuere a massa. \textbf{Sed} vitae ex ac \textbf{eros} dapibus iaculis. Sed \textbf{sit} amet augue eu justo ultricies facilisis. Pellentesque rhoncus ipsum ligula, at rhoncus mi sollicitudin in.

  • Windows .reg recognized, but no syntax highlighting?

    Locked
    4
    2 Votes
    4 Posts
    923 Views
    ytdlderY

    Ok, I got it to work; I just asked a friend to try this…

    The “problem” is, that there is no “Registry” style; at least visible in the UI, as it IS in the XML. The same is true with my friend -> the .reg highlighting works for him, because N++ recognizes them as “.ini” ;-)

    Anyway, the solution for now (for me at least):
    o) open the Style Configurator
    o) change ANY color for any language and SAVE
    o) optionally(?) restart N++
    o) now “Registry” is visible in the Style Configurator & the highlighting works!!

    further info: when comparing the “default” stylers.xml with the newly Notepad++ saved one, then there are several differences throughout the .xml
    -> maybe it’s “damaged” somewhere?

  • UDL: Code Folding Help

    Locked
    2
    0 Votes
    2 Posts
    584 Views
    EkopalypseE

    @Christian-Major

    what exactly is the problem?

  • Default font for Devanagiri script

    Locked
    9
    2 Votes
    9 Posts
    2k Views
    guy038G

    Hello, @naachhilfe-aachen, @peterjones, @ekopalypse, and All,

    May be, this post to @v-s-rawat ( and all the discussion, of course ) could be of interest for you !

    https://notepad-plus-plus.org/community/topic/17223/why-does-appears-as-in-npp/5

    You could, as well, download the Devanagari Google Noto font, for some tests ;-))

    Best Regards,

    guy038

  • Find only files with exact two words

    Locked
    12
    0 Votes
    12 Posts
    11k Views
    guy038G

    Hello, @ronny-kerk, @andrecool-68, @meta-chuh, @ekopalypse, @alan-kilborn and All,

    Here is a general method to list all files which contains word1 AND word2 AND word3 AND … wordN. The + of that solution is it should be fast enough and that you do not need to worry about regex problems, as the use of the (?s) syntax, look-arounds, and the order of the different words to match :-))

    In addition, even if you were about to look for 3 expressions, simultaneously, with a regex, you should have to test the different ranges, below :

    Word3........Word1..........Word2
    Word3........Word2..........Word1
    Word1........Word3..........Word2
    Word2........Word3..........Word1
    Word1........Word2..........Word3
    Word2........Word1..........Word3

    Rather fastidious, isn’t it ?

    So, in short, the different steps, of that general method, are :

    Search, in Normal mode, of each expression word1, word2,…,wordN and successive outputs in the Find result panel

    Paste of all the contents of the Find result panel in a new tab

    Use of a first regex S/R, in order to keep the absolute pathnames, only

    Alphabetic sort of these pathnames

    Use of a second regex S/R, to isolate the pathnames which are present N times

    Use of a third regex S/R to delete all the other pathnames, which do not contain the N words simultaneously

    OK, let’s go :

    Open the Find ( Ctrl + F ) or the Find in Files dialog ( Ctrl + Shift + F )

    Search, successively, for the expressions word1, word2wordN

    Tick, if necessary, the Match whole word only and/or the Match case options

    Tick the Wrap around option

    Select, preferably, the Normal search mode

    Click, either, on the Find All in All Opened Documents or the Find All button

    => After the N consecutive searches, you’ll get N searches in the Find result panel

    In the Find resul panel, select all the text ( Ctrl + A ) and copy it in the clipboard ( Ctrl + C )

    Open a new tab ( Ctrl + N ) and paste the clipboard’s contents ( Ctrl + V )

    Open the Replace dialog ( Ctrl + H )

    Perform the following regex S/R, to keep, only, the different absolute pathnames

    SEARCH (?-is)^(\t|Search).+\R|\x20\(\d+\x20hits?\)$

    REPLACE Leave EMPTY

    Tick the Wrap around option

    Select the Regular expression search mode

    Click on the Replace All button

    Now, let’s sort that text, with the option Search > Line Operations > Sort Lines Lexicographically Ascending

    Add a manual line-break at the very end of that sorted list ( IMPORTANT )

    Perform this second regex S/R, to detach the only pathnames present, N times

    SEARCH (^.+\R)\1{N-1} , where N represents the number of the searched expressions

    REPLACE \1\r\n ( or \1\n if Unix files )

    Tick the Wrap around option

    Click on the Replace All button

    So, for a search of any file, containing 4 expressions/words, just use the search regex (^.+\R)\1{3}

    Finally, using the final regex S/R, below, you’ll obtain the expected list, after suppression of the unwanted pathnames, and line-breaks :

    SEARCH ^.+\R(?!\R)|\R(?=\R)

    REPLACE Leave EMPTY

    Tick the Wrap around option

    Click on the Replace All button

    You’ll get, the list of all the absolute pathnames of files containing, at least once, all the words word1, word2wordN, in any order !

    Of course, you may search for expressions more complicated than simple words, using the Regular expression search mode !

    Best Regards,

    guy038

  • Can RegEx do the work for me?

    Locked
    17
    1 Votes
    17 Posts
    2k Views
    Thomas KarlssonT

    @Ekopalypse and @PeterJones - a big BIG thanks for all your help and support.

    Eko - your regex was marked up each block, both one and tow so it did the job but at the same time not.

    PeterJones - your regex just nailed it and I’m soooo happy!! So impressed. You have know idea how much time I will save now using your regex. Previously I have search and deleted all of theses 1000 and 1000 rows manually.

    You have made my day, week, year :) Thanks and thanks in million!

    Cheers from happy Scandinavia guy :)

  • Python in Notepad++

    Locked
    2
    1 Votes
    2 Posts
    718 Views
    EkopalypseE

    @Sean-Anigans

    well it depends what exactly you want to do and which python version you wanna use and how flexible it should be and …

    Npp does not have a builtin python interpreter but there are plugins which allow to execute python code
    either natively like PythonScript or with a local installation like NppExec. If you want to use Python3 then I would argue that NppExec is the way to go.
    NppExec provides a builtin console and a way to configure what needs to be executed.

  • Editing 'liquid' programming language

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    EkopalypseE

    @Nick-Felton

    if you find a builtin language which, more or less, meets your needs you might
    think about enhancing it by using a python script like discussed here.

  • Find an replace

    Locked
    4
    0 Votes
    4 Posts
    620 Views
    Thirsty for KnowledgeT

    Great, thanks for you fast help, now I’m happy :-)

  • 0 Votes
    2 Posts
    526 Views
    PeterJonesP

    @gayathri-priya, welcome to the Notepad++ Community forums.

    You said:

    I just want to select the name in each instance - just ABC and GBC.

    Assuming that your data rendered accurately, and any the name is the first word on the line after a “header line” that starts with literal “Name” (with no spaces before)

    Find = ^Name.*\R\K\w+ Mode = Regular Expression

    This finds a line starting with name, then advances the search thru the EOL for that line, moves down to the next line, starts the match over, and matches just the first “word” characters (alphanumeric and underscore, for regex)

    -----
    FYI: here is some helpful information for finding out more about regular expressions, and for formatting posts in this forum (especially quoting data) so that we can fully understand what you’re trying to ask:

    This forum is formatted using Markdown, with a help link buried on the little grey ? in the COMPOSE window/pane when writing your post. For more about how to use Markdown in this forum, please see @Scott-Sumner’s post in the “how to markdown code on this forum” topic, and my updates near the end. It is very important that you use these formatting tips – using single backtick marks around small snippets, and using code-quoting for pasting multiple lines from your example data files – because otherwise, the forum will change normal quotes ("") to curly “smart” quotes (“”), will change hyphens to dashes, will sometimes hide asterisks (or if your text is c:\folder\*.txt, it will show up as c:\folder*.txt, missing the backslash). If you want to clearly communicate your text data to us, you need to properly format it.

    If you have further search-and-replace (“matching”, “marking”, “bookmarking”, regular expression, “regex”) needs, study this FAQ and the documentation it points to. Before asking a new regex question, understand that for future requests, many of us will expect you to show what data you have (exactly), what data you want (exactly), what regex you already tried (to show that you’re showing effort), why you thought that regex would work (to prove it wasn’t just something randomly typed), and what data you’re getting with an explanation of why that result is wrong. When you show that effort, you’ll see us bend over backward to get things working for you. If you need help formatting, see the paragraph above.

    Please note that for all regex and related queries, it is best if you are explicit about what needs to match, and what shouldn’t match, and have multiple examples of both in your example dataset. Often, what shouldn’t match helps define the regular expression as much or more than what should match.

  • Need some help about GPG signatures... !

    12
    2 Votes
    12 Posts
    5k Views
    PeterJonesP

    Sorry about the delay. I had a busy family weekend this weekend.

    @guy038 said:

    I would like to re-create my key-pair, with a size of 4096 bytes ( instead of 2048 ) I suppose that the best way is to delete my present key-pair and generate a new key-pair, afterwards, isn’t it ?

    Yes.

    In other words, Don must be the ONLY person which could be able to recover the original .7z archive in the Test.7z file , from the npp.7.6.5.bin.7z.sig signature, with the command :

    gpg -u Notepad++ -o Test.7z -d npp.7.6.5.bin.7z.sig, because he would use the private key of his certificate ! Peter, am I right about it ?

    Not quite. A signature is a one-way hash: you can take a file, and easily create the signature of the file; however, it is impossible to go the reverse direction. For example, if I were to sign my copy of the gpg.exe, I would see:

    C:\Program Files (x86)\GnuPG\bin>gpg --detach gpg.exe C:\Program Files (x86)\GnuPG\bin>ls -latr gpg.exe* -rwxrwxrwx 1 Peter.Jones 0 1122816 2018-11-12 03:52 gpg.exe -rw-rw-rw- 1 Peter.Jones 0 566 2019-04-08 06:05 gpg.exe.sig

    There aren’t any compression algorithms that I know of that are good enough to encrypt-and-compress a 1.1MB gpg.exe into 566 bytes of gpg.exe.sig.

    All you can do with the signature for a file is (1) verify that the file matches the signature, and (2) that the person who claimed to sign it is the one who signed it (based on whether the public key matches what’s in your keyring).

    I think one of the confusions is that there are three different kinds of “signing” for files:

    Commands: -s, --sign make a signature --clear-sign make a clear text signature -b, --detach-sign make a detached signature The --sign (-s) creates an output file that includes the original file, plus your signature of that file. For example, in signing the standard-input as the input file: C:\Program Files (x86)\GnuPG\bin>gpg -a --sign hello world ^Z -----BEGIN PGP MESSAGE----- owEBWgKl/ZANAwAIAa7S8NjBGc6nAcsTYgBcq0qBaGVsbG8gd29ybGQNCokCMwQA ... -----END PGP MESSAGE----- The --clear-sign will do the same, but it will include the message in plain text, rather than encoded in the base-64 message, like: C:\Program Files (x86)\GnuPG\bin>gpg -a --clear-sign hello world ^Z -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 hello world -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEUi8A41Z69RBzWhJIrtLw2MEZzqcFAlyrSs0ACgkQrtLw2MEZ ... -----END PGP SIGNATURE----- Finally, --detach-sign (-b) creates a file that has only the signature, without the original file embedded. This is as my example above, with the signature for gpg.exe being only 566 bytes

    (in the examples above, I used the -a to “ascii-armor” the results, so the signatures were printable on the screen)

    When a software distributor has available for download the original file blah.zip, alongside another file called blah.zip.sig, the .sig file is usually the detached signature created by --detach-sign, so does not contain the original file as well.

    If you want a copy of the file that has the signature embedded in the archive, you would use just the --sign argument: without the -a ascii-armoring, it will go in blah.zip.gpg; with the -a ascii-armoring, it would go in blah.zip.asc.

    Maybe this series of examples will make more sense:

    ----

    Directory of C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example 04/08/2019 06:37 AM <DIR> . 04/08/2019 06:37 AM <DIR> .. 04/08/2019 06:36 AM 52,087 Temp.zip 1 File(s) 52,087 bytes 2 Dir(s) 110,105,284,608 bytes free C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>gpg --sign Temp.zip C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>dir Volume in drive C is Windows Directory of C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example 04/08/2019 06:37 AM <DIR> . 04/08/2019 06:37 AM <DIR> .. 04/08/2019 06:36 AM 52,087 Temp.zip 04/08/2019 06:37 AM 49,525 Temp.zip.gpg 2 File(s) 101,612 bytes 2 Dir(s) 110,105,165,824 bytes free C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>gpg -o NewTemp.zip --decrypt Temp.zip.gpg gpg: Signature made 04/08/19 06:37:27 Pacific Daylight Time gpg: using RSA key ZZZ___WORK_SIG___ZZZ gpg: Good signature from "Peter C. Jones <peter.jones@__work__>" [ultimate] gpg: aka "Peter C. Jones <peter.jones@__work__>" [ultimate] C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>dir Volume in drive C is Windows Directory of C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example 04/08/2019 06:37 AM <DIR> . 04/08/2019 06:37 AM <DIR> .. 04/08/2019 06:37 AM 52,087 NewTemp.zip 04/08/2019 06:36 AM 52,087 Temp.zip 04/08/2019 06:37 AM 49,525 Temp.zip.gpg 3 File(s) 153,699 bytes 2 Dir(s) 110,105,092,096 bytes free C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>fc Temp.zip NewTemp.zip Comparing files Temp.zip and NEWTEMP.ZIP FC: no differences encountered C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>del Temp.zip.gpg NewTemp.zip C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>gpg --detach-sign Temp.zip C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>dir Volume in drive C is Windows Directory of C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example 04/08/2019 06:39 AM <DIR> . 04/08/2019 06:39 AM <DIR> .. 04/08/2019 06:36 AM 52,087 Temp.zip 04/08/2019 06:39 AM 566 Temp.zip.sig 2 File(s) 52,653 bytes 2 Dir(s) 110,105,157,632 bytes free C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>gpg --verify Temp.zip.sig gpg: assuming signed data in 'Temp.zip' gpg: Signature made 04/08/19 06:39:03 Pacific Daylight Time gpg: using RSA key ZZZ___WORK_SIG___ZZZ gpg: Good signature from "Peter C. Jones <peter.jones@__work__>" [ultimate] gpg: aka "Peter C. Jones <peter.jones@__work__>" [ultimate] C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>dir Volume in drive C is Windows Directory of C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example 04/08/2019 06:39 AM <DIR> . 04/08/2019 06:39 AM <DIR> .. 04/08/2019 06:36 AM 52,087 Temp.zip 04/08/2019 06:39 AM 566 Temp.zip.sig 2 File(s) 52,653 bytes 2 Dir(s) 110,105,157,632 bytes free C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>gpg -o OutTemp.zip --decrypt Temp.zip.sig gpg: assuming signed data in 'Temp.zip' gpg: Signature made 04/08/19 06:39:03 Pacific Daylight Time gpg: using RSA key ZZZ___WORK_SIG___ZZZ gpg: Good signature from "Peter C. Jones <peter.jones@__work__>" [ultimate] gpg: aka "Peter C. Jones <peter.jones@__work__>" [ultimate] C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example>dir Volume in drive C is Windows Directory of C:\Users\PETER~1.JON\AppData\Local\Temp\gpg-example 04/08/2019 06:39 AM <DIR> . 04/08/2019 06:39 AM <DIR> .. 04/08/2019 06:36 AM 52,087 Temp.zip 04/08/2019 06:39 AM 566 Temp.zip.sig 2 File(s) 52,653 bytes 2 Dir(s) 110,105,100,288 bytes free
  • Backup Settings Resetting > Files LOST!

    Locked
    7
    0 Votes
    7 Posts
    2k Views
    Alan KilbornA

    Maybe a possible cause is running N++ with multiple instances and closing the non-original instance last? I seem to recall that some settings get disabled for a second+ instance and if you close the ORIGINAL instance with any others still open, when you finally close those, their settings become your new default settings. Maybe something to check…

  • Notepad++ raises an error when closed

    Locked
    12
    0 Votes
    12 Posts
    2k Views
    bolandrossB

    @guy038
    Hey, thanks for the suggestions!

    I was using v1.4.10.0 and updated to v1.4.11.0, but unfortunately the problem stayed.

  • Visual Foxpro Language

    Locked
    4
    0 Votes
    4 Posts
    4k Views
    dvince247D

    Thank you all for your time and for your know how. I appreciate that.

  • Can,t find a html or xml language to set

    Locked
    4
    2 Votes
    4 Posts
    1k Views
    Meta ChuhM

    welcome to the notepad++ community, @Konrad-Bińko

    please test the following, to verify, if a clean notepad++ would show html and xml language selections on your system:

    download the notepad++ 7.6.6. 64 bit portable version from >>> here <<<.
    (the portable version does not require any installation and runs completely independent and isolated from your installed version. all custom settings, as well as any stuff you might want to try at the portable version, will not modify your installed version)

    extract npp.7.6.6.bin.x64.zip to e.g. your desktop.

    important note: make sure to close all instances of notepad++ that might be running, before starting the portable version at the next step, to make sure you are using the portable version for this test.

    open the extracted npp.7.6.6.bin.x64 folder and start this portable version by double-clicking on notepad++.exe inside this folder.
    (note: notepad++.exe will just be seen as notepad++, if you have activated to hide all known file extensions at your windows explorer settings)

    test if html and xml selections, as well as css, are shown at the alphabetically cascaded language menu.

    if this portable version works for you as expected, please provide us with the debug information of your installed notepad++, by going to the menu ? > debug info... > copy debug info into clipboard and pasting it here, for further guides and fixes.