• Can a UDL delimeter style's Close be made to ignore tabbed new lines?

    5
    0 Votes
    5 Posts
    376 Views
    David CoburnD

    @Ekopalypse
    That’s…a very good point! It’s more efficient and less cluttered to just have a unique ending delimiter rather than modify the beginning of every line. Thanks!

  • work on several lines?

    6
    0 Votes
    6 Posts
    374 Views
    guy038G

    Hello, @zen2cool and All,

    If I understand you, correctly, you would like that, given the text :

    +====================== Ticket 16392 ======================= 1 6X50G GO MY LITTLE ONE 2.89 2.89 2.89 B 1 400G NEXP CAT STER STER 3.49 3.49 3.49 B TOTAL EUROS: 3.38

    You expect the text :

    1 6X50G GO MY LITTLE ONE 2.89 2.89 2.89 B 1 400G NEXP CAT STER STER 3.49 3.49 3.49 B

    Am I right about it ? If so, use this regex S/R :

    SEARCH (?-is)^.+Ticket.+\R\R|\RTOTAL EUROS.+\R

    REPLACE Leave Empty

    Best Reards,

    guy038

  • How to do multiple search for a list of strings

    3
    0 Votes
    3 Posts
    6k Views
    guy038G

    Hello, @arhack-bifrost, @Dinkumoil 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, my reply may be out of date !

    However, the macro, below, with 2 almost identical parts, is able to first searches, recursively, for the expression variableNumber1 in all the files of your Folder_Path. Secondly, it searches, in the same way, for the expression variableNumber2 and, finally, shows the 2 successive search operations, in the Find Result panel :-))

    <Macro name="searchTest" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="variableNumber1" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1653" wParam="0" lParam="0" sParam="X:\The_path_of_MyFolder\" /> <Action type="3" message="1652" wParam="0" lParam="0" sParam="*.c" /> <Action type="3" message="1702" wParam="0" lParam="800" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1656" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="variableNumber2" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1653" wParam="0" lParam="0" sParam="X:\The_path_of_MyFolder\" /> <Action type="3" message="1652" wParam="0" lParam="0" sParam="*.c" /> <Action type="3" message="1702" wParam="0" lParam="800" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1656" sParam="" /> </Macro>

    Notes :

    Of course, you may add as many sections as you want to perform other searches ;-))

    The parameters value 800 means : 512 ( Direction = Down ) + 256 ( Wrap around ) + 32 = Search in sub-folders

    Two important remarks :

    Your initial macro, in your post, contains a syntax error. Indeed, the line : <Action type="3" message="1652" wParam="0" lParam="0" sParam="*.c*"" />

    should be :

    <Action type="3" message="1652" wParam="0" lParam="0" sParam="*.c" /> Secondly, note that, in all caases, the absolute folder path, let’s say "X:\The_path_of_MyFolder\", must, necessarily, ends with a backslash symbol ( \ )

    Cheers,

    guy038

  • re-emergence of an old issue

    5
    0 Votes
    5 Posts
    424 Views
    Jim JulianJ

    @PeterJones Thanks for the redirect. I read more closely and made the change.
    Thanks again.

  • Find results - Copy name of files (without hits)

    2
    0 Votes
    2 Posts
    229 Views
    guy038G

    Hello @vasile-caraus and All,

    Not very difficult, indeed !

    Do your search in files ( Ctrl + Shift + F )

    Once the Find Result panel opened, right-click inside and choose the option Select all

    Hit the shortcut Ctrl + C ( Do NOT use the Copy option of the context menu ! )

    Open a new tab ( Ctrl + N )

    Paste the clipboard ( Ctrl + V )

    Now, in that new file, perform the following regex S/R :

    SEARCH (?-si)^(?:(Search).+|\x20\x20(.+)\(.+?\)$|\t.+\R)

    REPLACE (?1echo @OFF)(?2Del\x20\2\x20/p)

    Save this new file, in your N++ directory, as, let’s say Suppression.bat

    Execute the option Run > Run... ( of hit the F5 key )

    Type in the command cmd /k Suppression.bat

    Valid the suppression of each file, by answering y

    Close the DOS window

    Et voilà !

    Remark : If your prefer to delete all files in one go, change the Replace zone as (?1echo @OFF)(?2Del\x20\2)

    Best Regards,

    guy038

  • is there regex works for col ?

    9
    0 Votes
    9 Posts
    548 Views
    guy038G

    Hi, @gurikbal-singh 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, my reply is probably out of date and may be obsolete !

    To strictly answer your question, if you want that the second column starts at column N, use the generic regex S/R :

    SEARCH (?-s)^.{N-2}\K\x20+

    REPLACE Leave Empty

    and click, exclusively on the Replace All button

    Thus, if you need that the second column starts, let’s say, at column 21, use the following S/R :

    SEARCH (?-s)^.{19}\K\x20+

    REPLACE Leave Empty

    Of course, the number N must be in the interval [a,b], where :

    a = Maximum length of column 1 + 1

    b = Minimum column starting column 2 - 1

    So, in our example : a = 17 + 1 = 18 and b = 31 - 1 = 30 => N must be in interval [18-30]

    Best Regards,

    guy038

  • 0 Votes
    7 Posts
    1k Views
    guy038G

    Hello, @darklinkpower,

    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, @darklinkpower, my reply is quite out of date. But if you still look for a regex solution I can take up the challenge of performing this S/R with regexes !

    However you must give me a real example of your 2 ( short ) files A and B, as well as the expected real output file, from these 2 input files

    Simply, as your files are XML ones, in your future post, write your code in blocks, like below :

    ~~~xml


    ~~~

    Just to give you an idea, of the regexes’s powerful, let’s suppose the input text, below :

    <text><![line a[line b, line c, line d, A1, A2, A3]]></text> <text><![line a[line b, line c, line d, B1, B2, B3]]></text> <text><![line a[line b, line c, line d, line e, line f, line g, line h, C1, C2, C3, C4]]></text> <text><![line a[line b, line c, line d, line e, line f, line g, line h, D1, D2, D3, D4]]></text> <text><![line a[Small test, E1, E2, E3, E4, E5, E6, E7, E8, E9]]></text> <text><![line a[Small test, F1, F2, F3, F4, F5, F6, F7, F8, F9]]></text> <text><![line a[word 1, G1, G2]]></text> <text><![line a[word 1, H1, H2]]></text> <text><![line a[I1]]></text> <text><![line a[J1]]></text>

    Then, the following regex S/R :

    SEARCH (?-s)^(.+)(.+)\]\]></text>(\R)\1(.+)\R

    REPLACE \1\2, \4\3

    will change, when you click on the Replace All button, in one go, the text as below :

    <text><![line a[line b, line c, line d, A1, A2, A3, B1, B2, B3]]></text> <text><![line a[line b, line c, line d, line e, line f, line g, line h, C1, C2, C3, C4, D1, D2, D3, D4]]></text> <text><![line a[Small test, E1, E2, E3, E4, E5, E6, E7, E8, E9, F1, F2, F3, F4, F5, F6, F7, F8, F9]]></text> <text><![line a[word 1, G1, G2, H1, H2]]></text> <text><![line a[I1, J1]]></text>

    As you can see, this regex S/R is able to differentiate the first common part of two consecutive lines from the second variable part which must be merged in one line only ;-))

    So, see you later !

    Best Regards,

    guy038

  • Notapad++ opens ALL FILES on folder AND subfolders

    5
    0 Votes
    5 Posts
    1k Views
    EkopalypseE

    Just for completeness, I’m talking about this RC version.

  • Regex to find any lines that do NOT have a specific number of a character

    30
    0 Votes
    30 Posts
    9k Views
    guy038G

    Hi, @mark-yorkovich, and All,

    See my very late regex solution , below :

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

    Best Regards,

    guy038

  • Regex - find occurence of 2 consecutive lines

    11
    0 Votes
    11 Posts
    1k Views
    guy038G

    Hello, @fernando-avendaño217 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, Fernando, my reply is quite out of date. However, just for info, here is my solution :

    SEARCH (?-is)^.+\bChecking\b.*\R.+\bFailed qualification\R

    REPLACE Leave EMPTY

    Notes :

    First the part (?-is) are in-line modifiers which implies :

    The search is processed in a non-insensitive way ( -i )

    The regex dot char ( . ) match a single standard character and not any EOF char ( -s )

    Then the part ^.+\bChecking\b.*\R looks for an entire line containing the word Checking, with that exact case

    Finally the part .+\bFailed qualification\R grabs any entire next line, which contains the exact expression Failed qualification, with that exact case

    As replacement is empty, these two consecutive entire lines are simply deleted :-))

    Best Regards,

    guy038

  • Change and move a string

    5
    1 Votes
    5 Posts
    420 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
    3k Views
    GaroKG

    Problem solved. Thanks for the answer!

  • Setting font for printed doc

    3
    0 Votes
    3 Posts
    781 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
    451 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
    189 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
    428 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.