• Change and move a string

    5
    1 Votes
    5 Posts
    426 Views
    guy038G

    Hello, @knowledge-base, @ekopalypse,

    I was away from the N++ community since more than a month ( see my post below )

    https://community.notepad-plus-plus.org/post/47895

    So, just for info ! The @ekopalypse solution can even be shortened :

    FIND combobox( ".+?"\])

    REPLACE group\1.combobox

    Best Regards,

    guy038

  • Reg Ex to find lines with linefeeds in csv

    13
    1 Votes
    13 Posts
    3k Views
    guy038G

    Hello, @mark-yorkovich, @alan-kilborn and All,

    I was away from the N++ community since more than a month ( see my post below )

    https://community.notepad-plus-plus.org/post/47895

    So, Mark, my reply is quite out of date. However, just for info, here is a one-go regex, which does what you want :

    SEARCH (?-s)([^|\n]*\|){9}.*\n|\n(?!([^|\n]*\|){9}.*\n)

    REPLACE (?1$0:LINEFEED)

    It’s the equivalent regex S/R to the Alan’s one. As you just want to replace with a single dummy char, use, for instance, the following Replace zone :

    REPLACE (?1$0:#)

    Notes :

    First, the part (?-s) forces the regex engine to consider any dot ( . ) as a single standard character ( Not an EOF one ! )

    Then, the search regex processes one of the two alternatives :

    (?-s)([^|\n]*\|){9}.*\n which looks for entire correct lines, containing 9 pipe characters. In replacement, as group 1 exists, the overall match ( $0 ) is just re-written

    \n(?!([^|\n]*\|){9}.*\n) which simply searches a line-feed char, only if NOT followed with a correct record. In replacement, as group 1 does not exist, the part after the colon ( LINEFEED or # ) replaces the \n character

    Best Regards,

    guy038

  • Quickly convert a lot of files to another encoding?

    4
    0 Votes
    4 Posts
    4k Views
    GaroKG

    Problem solved. Thanks for the answer!

  • Setting font for printed doc

    3
    0 Votes
    3 Posts
    807 Views
    PeterJonesP

    @Rick-Nakroshis ,

    The printing font size is determined by a combination of factors. Primarily, it is set by the default font size in Notepad++ (Settings > Style Configurator > Global Styles > Default Style) as well as the font-size adjustments for any syntax highlighting that’s active in your document. Secondarily, it can be influenced by the internal Scintilla component’s SCI_SETPRINTMAGNIFICATION message (which is the 2146 that @Prahlad-Makwana4145 used); as described in the SCI_SETPRINTMAGNIFICATION description in Scintilla docs, +2 tells scintilla to add two points to the font size, and -4 would subtract 4.

    Note that when I tried @Prahlad-Makwana4145 's instructions, the hidden console window (which was intentionally hidden by NPP_CONSOLE 0) shows an error: it doesn’t like the + from +2. I had to use SCI_SENDMSG 2146 2 to get the effect described. (It does, however, recognize -2 properly to make the font smaller when printing.)

    Unless you are using a tiny font in your Notepad++ window directly, however, I cannot understand why yours would be starting with a tiny font when printing. What font size is your Notepad++ style configurator set at?

  • -1 Votes
    5 Posts
    1k Views
    GOoOl ChannelG

    ok thnx bro for the help i appreciate it and it works for me now
    and i will take a look to the documents you send me

  • Language type same as defined type but with different file extension

    2
    0 Votes
    2 Posts
    471 Views
    PeterJonesP

    @Jim-Woodward said in Language type same as defined type but with different file extension:

    I tried setting up Notepad++ to recognize .pts as a .vb script. I did get it correct that when I browse to a file with .pts extension and open it, that it uses the VB language text color encoding and font settings in the editting window.

    As you implied, Settings > Style Configurator > VB/VBS, setting User ext.: to pts will enable Notepad++ to recognize .pts files as VB for syntax highlighting. (Made it explicit, in case future people searching were looking for the first half of the answer, rather than the second half.)

    However if I do a save as of the same file to another file name it changes the extension to .vb instead of leaving it as .pts. How do I get it to save it as .pts and still realize that is a VB style script?

    There are two versions of the save/save-as dialog, which Notepad++ cleverly calls “old style” vs “new style”. See documentation for Settings > Preferences > Default Directory, which says,

    ☐ Use new style dialog (without file extension feature & Unix style path capacity): Windows allows for two styles of open/save dialogs.

    “old style” has “Quick Access”, “Desktop”, and others as icon-buttons along the left; it will auto-apply the selected file-type’s extension to the file (so typing a filename of blah when a file type of “Normal text file (.txt)” is selected will save blah.txt); it will also allow using Unix-style backslashes as a path separator, rather than Windows-style forward slashes.

    “new style” does not have the icon-buttons (instead, Windows presents those in the tree, similar to other drives and folders); even when a file-type is selected, the user is required to specify the desired file extension (thus the file-type selector is primarily for filtering what existing files are listed in the directory listing); and it will not understand Unix-style backslashes as path separators.

    Because both dialogs are windows-supplied dialogs, there isn’t an easy way to change the list of file-types-and-extensions for the old-style. I highly recommend using the new-style dialog, which will allow you, the user, to determine the appropriate extension for a given file, rather than taking the first extension for the given “type” in the drop-down box. This helps both in a case like yours (where the builtin list doesn’t include your custom extension), but also in the more global case where someone wants to Save As a C++ Source File, and it defaults to naming it .h, because that happened to be first in the list!

    1579cba0-fc9a-4943-aede-842e2a9ec1c4-image.png

    Of course, with the new-style dialog, you have to type 2-4 more characters when naming the file (depending on the extension you want), but since the old-style windows dialog gives the wrong extension anyway in many circumstances, it’s better to choose the one that will always give the extension you want.

    (The other thing to make sure is that Windows Explorer is set up to not hide extensions, otherwise, you may get confused when the extension “disappears” after you’ve saved.)

  • Spacing issue with braces.

    2
    0 Votes
    2 Posts
    195 Views
    PeterJonesP

    Try a different font:
    b046e92b-478a-49ad-8d1b-4517860222fa-image.png

    I am using DejaVu Sans Mono, but there are plenty that work right.

  • remove multiple spaces between numers for : (help needed)

    4
    0 Votes
    4 Posts
    450 Views
    PeterJonesP

    discussion moved to here

  • How to search for unknown 3-digit characters with black background

    5
    1 Votes
    5 Posts
    26k Views
    Cybelle SaffaC

    Thank you soo much for your instructions! They saved me a whole bunch of time!

  • 0 Votes
    4 Posts
    1k Views
    Alan KilbornA

    @Alexander-Kuhn

    To see how to make a “suggestion for improvement”, read this.

  • Notepad++ 7.8 crashes

    5
    0 Votes
    5 Posts
    593 Views
    Christoph EderC

    Thank you. That helped.

  • Use NPP as a Diary/Journal?

    5
    0 Votes
    5 Posts
    5k Views
    Alan KilbornA

    @akshay-wayne

    It appears that @Scott-Sumner used Pythonscript to create a little embedded program that will insert that. Pythonscripts can be bound to keystroke combinations.

  • Coloring problem

    1
    0 Votes
    1 Posts
    166 Views
    No one has replied
  • How to edit the XML macros in NotePad++

    5
    0 Votes
    5 Posts
    4k Views
    Arhack BifrostA

    @dinkumoil Thanks for the “FindStr” solution it seems to work but not in a “neat” way since the resulat are mixed and I want to stick to a “NotePadian” solution (this way I can get my hand dirty with some scripts and maybe plugin devloppement), my post here was to see the possibilities i can get by manipulating the macros file and not a repetition of the issue.
    currently I’m working on a script using PyhtonScript as you suggested and I’m sure the community will be great help for me

    cheers

  • Marking text with Regex and copy-paste it

    3
    0 Votes
    3 Posts
    492 Views
    Abdullah EksiogluA

    Thank you Alan. I see that no quick solution to copy all marked text, i tried Scott Sumner solution and it works fine.

  • Can you stop Notepad++ from selecting whole words?

    2
    0 Votes
    2 Posts
    237 Views
    Alan KilbornA

    @Yannick-Anné said in Can you stop Notepad++ from selecting whole words?:

    dragging my cursor across a line

    This implies the mouse, correct? I’ve never seen this behavior, mouse-drag selecting always does one character at a time.

  • RegEx and Replace..

    5
    0 Votes
    5 Posts
    477 Views
    Alan KilbornA

    @Eddie-Adolfsson

    Just informationally, you can remove lines NOT containing a specific bit of text via finding it with the following method:

    Say you want to match lines that DON’T contain abc. Then your search expression might be ^(?-s)(?!.*abc).*\R. If you replace with nothing when you run a replacement you effectively remove those lines.

    Obviously you can replace abc with whatever you need. It doesn’t have to be constant text, it can be a regular expression of course.

  • CR/LF is appearing Notepad++ when reading Excel PRN file.

    2
    0 Votes
    2 Posts
    489 Views
    Alan KilbornA

    You aren’t “importing”, you are simply opening a file. Notepad++ isn’t doing anything to your file; whatever you are seeing is whatever is there already. Suggest you understand your data/process better…

  • What's the command to Open a Folder as Workspace?

    4
    1 Votes
    4 Posts
    2k Views
    Marios T.M

    @Alan-Kilborn said in What's the command to Open a Folder as Workspace?:

    @Marios-T

    Gurkibal could have narrowed it down better for you:

    notepad++ -openFoldersAsWorkspace c:\src\myProj01 c:\src\myProj02

    Haha!
    No it’s ok!
    Thanks both of you for your answers :)
    Problem solved!

  • Block paste?

    4
    0 Votes
    4 Posts
    2k Views
    Alan KilbornA

    @Stein-Garnes said in Block paste?:

    if I paste in npp (below or in another window) and then do a block copy/paste it works

    It would be nice to have a single-step way to do this. Perhaps a paste-special type thing where you can “Paste as rectangular block” (as long as what is in the clipboard is appropriate for that type of pasting).