• 0 Votes
    2 Posts
    2k Views
    Jim DaileyJ

    A DOS script master could probably do this with only shell commands in the batch file, but it is likely done easier by invoking some scripting language like AWK, PERL, or Python. It might even be possible using NPP, but I wouldn’t try to do it that way.

  • How do I create character blocks of specified length?

    Locked
    4
    0 Votes
    4 Posts
    3k Views
    guy038G

    Hello Andrew,

    An other formulation, which separates any text in blocks of five characters long, whatever they are, would be :

    SEARCH .{5}(?=.)

    REPLACE $0\x20

    Notes :

    The .{5} syntax matches for five consecutive standard characters

    I added the look-ahead form (?=.) , just to ensure that NO extra-space will be added, at the end of each long-line scan

    The $0 syntax represents the match of the whole regex, that is to say, any block of five characters

    And \x20 is, simply, the hexadecimal form of the space character

    Best Regards,

    guy038

  • Duplicate lines

    Locked
    4
    0 Votes
    4 Posts
    11k Views
    guy038G

    Hello, Dusty Pulver,

    An other simple possibility, that does not need any plugin, would be :

    Sort your file, with the native N+++ sort ( menu option Edit - Line Operations - Sort Lines Lexicographically Ascending )

    Move to the beginning of your file ( CTRL + Origin )

    Open the Replace dialog ( CTRL + H )

    Perform the S/R, below, in Regular expression search mode :

    SEARCH : (?-s)^(.*\R)\1+

    REPLACE : \1

    Notes :

    The (?-s) modifier ensures that the dot will match standard characters, only, even if you previously checked the . matches newline option !

    The \R stands for any kind of EOL character(s)

    Best Regards,

    guy038

  • UserDefinedLanguage folder question

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @Heng-Yuan

    UDL, afaik - no.
    Python Script plugin and proper script - I guess.

    Cheers
    Claudia

  • iostream: No such file or directory

    Locked
    5
    0 Votes
    5 Posts
    5k Views
    Claudia FrankC

    @Javitxu-Namas

    npp doesn’t know anything about mingw as well as nppexec.
    You need to provide the information where to find the libraries, headers etc…
    The example above should give you an idea what needs to be done.

    // c Compiles without linking. // Dname=definition Defines a symbol (as with #define). // E Stop after the preprocessing stage. // g Produce debugging information. // I Searches the given directory for "includes". // llibname Searches the specified library when linking. // ofilename Names the output file. // -help Provides (some) help. // -version Displays the version number. g++ --version // print compiler version ENV_SET PATH = D:\ProgramData\Compiler\MinGW\bin;$(SYS.PATH) // extend path variable //g++ -Wall -g -std=c++11 -o $(NAME_PART).exe $(FULL_CURRENT_PATH) -Ld D:\ProgramData\Compiler\MinGW\lib\libshlwapi.a g++ -Wall -g -std=c++11 -o $(NAME_PART).exe $(FULL_CURRENT_PATH) -ID:\Repositories\boost\ $(NAME_PART).exe

    Cheers
    Claudia

  • 0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @Leo-Nicholson

    did you check whether one of already created udl fit your needs?

    Cheers
    Claudia

  • String before symbol formatted in my User Defined Language UDL

    9
    0 Votes
    9 Posts
    5k Views
    Claudia FrankC

    @Eli-Chavez

    …but i thought id ask.

    always welcome.

    Cheers
    Claudia

  • Plugin Manager shows no plugins to install

    Locked
    4
    0 Votes
    4 Posts
    11k Views
    Claudia FrankC

    @usha-mandava

    npp (or better plugin manager) sends an http get request to sourceforge server, nothing special. (TCP/PORT 80)
    Could it be that you have multiple network interfaces in your pc? Routing issue?
    Can you open sourceforge website on that pc?

    Cheers
    Claudia

  • separate only duplicate numbers from file

    Locked
    6
    0 Votes
    6 Posts
    4k Views
    Jim DaileyJ

    Here’s an AWK script that can do the trick for you:

    # If there is something other than whitespace on a line: NF { # Use the text as an array index and count how many times it appears Line[$0]++ } # Once the whole file is done, spit out every line that was duplicated 2 or more # times, the number of times they were duplcated. # # If Line[line] == 1, then the line appeared only 1 time (it is unique). # If Line[line] > 1, then the line appeared that many times. END { for (line in Line) { for (i = 1; Line[line] > 1 && i <= Line[line]; i++) { print line } } }

    I use GNU AWK for windows (gawk.exe). If you save the script as dup.awk, then:

    gawk -f .\dup.awk <name of your 90000 line file> > dupout.txt

    will create dupout.txt with all the duplicated lines. I used the data in your original post and let the output go to standard out:

    C:\temp\awk>type input.txt 919913209647 02:38:47 919979418778 02:57:03 918980055979 02:46:12 919428616318 02:46:32 919512672560 02:46:33 919512646084 02:46:52 919512497164 02:48:13 919512497164 02:48:13 919913029225 02:50:23 917567814941 03:02:35 919537722335 03:18:41 918980299814 03:24:49 919727009323 03:29:44 C:\temp\awk>gawk -f .\dup.awk input.txt 919512497164 02:48:13 919512497164 02:48:13 C:\temp\awk>
  • Python PEP8 syntax warnings

    Locked
    7
    0 Votes
    7 Posts
    8k Views
    Scott SumnerS

    For the record, when I read something like the OP’s question, I presume that they have done their due diligence and have explored external options and have a good reason for wanting to do what they are asking about, inside Notepad++. Not always a good presumption, I guess, but this is a N++ forum, after all. :)

  • Drag-and-drop files not working in latest version 6.9

    12
    0 Votes
    12 Posts
    11k Views
    AxaZolA

    Seriously… 6 months is past and still no changes ? WTF !??

  • Custom Keyword highlighting

    8
    0 Votes
    8 Posts
    9k Views
    Claudia FrankC

    Hello Hans,

    sorry, unfortunately I didn’t find a reliable way to style text while a lexer is active.

    Cheers
    Claudia

  • How do I place a recorded macro back to the "Play" button?

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @Me-andmi

    sorry, afaik there is no way currently to reassign it.
    Do you know that you can assign shortcuts to the macro or
    that you can put the macros into the context menu? Maybe a useful workaround?

    Cheers
    Claudia

  • Very simple regex question

    Locked
    4
    0 Votes
    4 Posts
    2k Views
    dailD

    how would I eliminate “I” from ([A-Z])

    [A-HJ-Z]

    This is probably the most straight forward way of doing it.

  • Guessing Answer is No.... Can Notepad++ Vlookup?

    Locked
    5
    0 Votes
    5 Posts
    7k Views
    Felix AF

    Since it can be made to look at 2 different files with the compare plugin and even to run sql queries, I’m a little surprised that it wouldn’t be easier. The ultimate solution (at least for my set up) would be a parser in PHP. I’ll get there but until then, Notepad++ has done wonders on the desktop. At least now I know not to look for this functionality based on your comment. You’ve saved me lots of time b/c I won’t go looking for ways to accomplish this in Notepad++. I hear you when you say it’s technically possible but not advisable. Thanks!

  • numbers become letters and stuff

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Martin TybergM

    Fixed it

  • 0 Votes
    10 Posts
    8k Views
    Felix AF

    Hi Guy, just curious if there is an easy way to make the regex flexible where it can to the insertion of the text on all lines be there 3, 6, or a 100?

  • Cancel adding installation

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    dailD

    Which plugins is pending to install

    Not sure exactly. There are a few plugins that need admin rights, such as PythonScript, XMLTools, and possibly a couple others. You may be able to find out if you take a look at the file I mention below…

    How can I cancel that installation.

    There should be a file somewhere called PluginManagerGpup.xml. If you delete that then you should be fine. Not sure where that will be stored exactly (maybe %APPDATA%?) since you are running a portable version.

  • how can i save tsv document on notepad ++?

    Locked
    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Google feature? But there is nothing.

    12
    0 Votes
    12 Posts
    9k Views
    Almir CanellaA

    @Claudia-Frank Thank you, I Hadn’t. I had one for older build backup of shortcuts.xml and some problems because of that. Now it works! Appreciated!