• Advanced replace

    4
    0 Votes
    4 Posts
    1k Views
    PeterJonesP

    @test-test-0 said,

    @PeterJones said in Advanced replace:

    ^\d{2}:\d{2}:\d{2}\h*

    That’s basically what I want, but sometimes it will be slight difference in the characters order in a specific line that I want to delete.
    In simple words - sometimes the time (like 09:15:01) will be in the middle of a text line, not just in the beginning.
    Here’s an actual example of what I want to do:
    Take out those numbers next to the “Line” word, and additionally delete the date and time from each line.

    When asking for search-and-replace help, context in regular expressions is everything. If you’re asking for help with regular expressions, you need to be as clear as possible. You said nothing about removing more than just the time.

    I tried to use the syntax in FIND you suggested, unfortunately it didn’t work for me.

    Because the requirements you listed were different than the requirements you had.

    30bc0180-9857-4405-beca-1015a278fbaa-image.png

    You still haven’t followed my advice above – presenting before and after data as text (marked with the </> button so it formats as unmodified text in the forum), so that we can copy/paste your text to experiment with – so we’ve still just got your verbal description of the problem as to what you want it to look like when it is done. So there’s a good chance that this second expression I give you won’t work either, because you have not defined your problem to us sufficiently.

    I am going to assume you want to convert Line NUMBER: DATE TIME TEXT TO KEEP (where DATE and TIME match the YYYY-MM-DD HH:MM:SS,FFF format that you implied this time around; I am just assuming that NUMBER will be an integer with at least one digit) into Line: TEXT TO KEEP, but I will make the replace expression obvious enough that if you don’t want the Line: left in the final result, you can take it out.

    FIND = (?-s)Line\x20\d+:\x20\d{4}-\d{2}-\d{2}\x20\d{2}:\d{2}:\d{2},\d{3}\x20 I used \x20 to indicate the space character, so that there was no question (especially at the end, where I want to delete the final space after the milliseconds as well) REPLACE = Line:\x20 If you don’t want it prefixed with Line: and a space, just leave the REPLACE empty Mode = Regular Expression

    Here is an example it works with:

    Before:

    Line 8: 2020-05-12 12:02:03,789 INFO First Line Line 64: 2020-05-12 12:02:06,789 INFO Second Line Line 512: 2020-05-12 12:02:09,789 DATA Third Line Line 8192: 2020-05-12 12:02:13,789 STUFF Fourth Line Line 16384: 2020-05-12 12:02:16,789 INFO Fifth Line 32768: 2020-05-12 12:02:16,789 INFO Sixth Line 65536: 2020-05-12 12:02:16,789 INFO Seventh Heaven

    After:

    Line: INFO First Line Line: INFO Second Line Line: DATA Third Line Line: STUFF Fourth Line Line: INFO Fifth Line: INFO Sixth Line: INFO Seventh Heaven

    If you need changes compared to this, you will have to do a better job of showing that you want to help us help you. I have already explained how to do this in my first post.

  • Problem with User-Defined Language userDefineLang_AHK.xml

    2
    0 Votes
    2 Posts
    319 Views
    EkopalypseE

    @hardcider09

    Without having a reproducible way to do/observe it, it is hard to say.
    Personally, I use two UDLs quite often and have not observed such behavior, but that doesn’t mean it’s not there, obviously, just that I may not be acting in the order in which you do.

  • Function List - Help for adding a custom language

    Locked
    8
    1 Votes
    8 Posts
    2k Views
    guy038G

    Hi, @mateos81 and All,

    Concerning your present parser :

    <parser id="ob_function_old" displayName="Omni-Bot (old)" commentExpr="((/\*.*?\*)/|(//.*?$))"> <function mainExpr="^[ \t]*(global |member )?([0-9A-Za-z_\.]+)(\ *)\=(\ *)function(\ *)\(([0-9A-Za-z_\,\ ]*)\)" displayMode="$functionName"> <functionName> <nameExpr expr="^[ \t]*(global |member )?\K[0-9A-Za-z_\.]+"/> </functionName> </function> </parser>

    I modified and simplified the different regexes, in the same way I did, in my previous post ! So, I ended up with this version :

    <parser id="ob_function_old" displayName="Omni-Bot (old)" commentExpr="/\*.*?\*/|//.*?$"> <function mainExpr="(?-i)^\h*(global\x20|member\x20)?[\w.]+\x20*=(\x20*function\x20*\([\w,\x20]*\))?\s*\{" displayMode="$functionName"> <functionName> <nameExpr expr="(?-i)^\h*(global\x20|member\x20)?\K[\w.]+"/> </functionName> </function> </parser>

    Remark :

    Because of the in-line // comment, the function AXIS does not appear in the function-list panel. Logical ! AXIS = // Team

    So, three work-around syntaxes are possible :

    AXIS = { // Team AllBots = true, // Each bot is considered for a role

    or :

    AXIS = { // Team AllBots = true, // Each bot is considered for a role

    or :

    // Team AXIS = { AllBots = true, // Each bot is considered for a role

    Note that, with the 1st solution, there must be, at least, two blank characters, between the { and the start comment //, although I don’t understand exactly why ;-))

    Given your example file :    https://pastebin.com/Uk9jdfzw    and using the syntax AXIS = { // Team, the function List panel displays the 22 elements, below :

    Map Navigation jump navigate Roles AXIS DEFENDER DEFENDER1 AxisBridgeSuicide OnEnter Test0 Test Test2 Test_3 OnMapLoad OnBotJoin InitializeRoutes MapRoutes BUILD_Command_POST NonFunctionClassLevelTest NonFunctionClassLevelTestWithFunction Test

    I didn’t study your enhanced parser, with classRange node, yet ! I hope to be able to get some results as I know very little about objects classes :-((

    Cheers,

    guy038

    P.S. :

    To test your parser, I used the following association

    <association id= "ob_function_old" langID= "0" />

    which enabled me to simply use Normal Text language ;-))

    IMPORTANT : Follow the link, below, for further discussion !

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

  • Highlighting not functioning at all

    3
    0 Votes
    3 Posts
    1k Views
    Charles BogelC

    Thanks for reply. I forgot to mention I had tried various styles, and the problem persists. Here is a screenshot of that same screen, keeping in mind the background I have hit ctrl-a and the entire document is selected.

    ![0_1589320101262_7bb2a215-cfd1-47cb-b262-6a3788ebbd99-image.png](Uploading 100%)

    https://i.imgur.com/14o0u6q.png

  • Use Text File to Remove Lines?

    9
    1 Votes
    9 Posts
    3k Views
    guy038G

    Hi, @mrmagnum8841, @peterjones, @alan-kilborn and All,

    When elaborating my previous post, I remenbered, from this post :

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

    This following regex (?-s)^(.+\R)(?=(?s).+?^\1), which, indeed, could work with a 5 Mb file ,containing more than 200,000 lines ! Much better, isn’t it ?

    Seemingly, the fact that, in this regex, the group 1 corresponds to an entire line, with its line-break, whereas the (?-si)^.*,\x20(\w+),.*\R(?=(?s).+?^\1$) syntax stores, only, the ID### part, of each line, in group 1 ( which fails with a file over 82 Kb - 2,500 lines ! ) makes all the difference !! Why ?

    As you said, Peter, it was a mental exercise, not specifically intended for the OP, in order to find a correct way to filter fairly large files, as I’m rather irritated by the limitations of my various regular expression attempts :-((

    Cheers,

    guy038

  • put capital after a tag

    11
    0 Votes
    11 Posts
    7k Views
    Star XS

    Hi,

    follow below steps

    select all ctrl+A
    select TextFx from the top Menu
    then select TextFx Characters
    then select Proper Case and it will change all first letters of every line to Upper Case

    Cheers,

  • Help, почему черное?

    3
    0 Votes
    3 Posts
    410 Views
    dailD

    My guess is a compiled Lua file

  • Erase the Space Before a Decimal and Add a Comma

    4
    0 Votes
    4 Posts
    394 Views
    Marie PalmquistM

    @astrosofista Thanks a million!

  • TagLEET error: "access violation"

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP

    @Michael-Vincent said in TagLEET error: "access violation":

    @PeterJones said in TagLEET error: "access violation":

    So then I went to the sourceforge repo and saw v1.3.2 was available there.

    Interesting. Sounds like the Plugin Admin links are both for the 32-bit version? Since I’ve been using a modified copy, I never noticed.

    Nope. Putting the 32bit in the 64bit plugin folder, I get explicit 32-bit error
    20bd68f0-ea25-436f-82d3-723fd4e68376-image.png

    I tried downloading the 64bit directly from here, and got the same access violation.

    I also verified nppPluginList correctly links to the 64bit zip for 1.3.1.

    Sounds like it’s working for you now?

    Yes, v1.3.2-64bit worked right off the bat, no problem.

    I don’t find it that useful in single file projects - I just use function list,

    That’s probably why it never “stuck” when I’d tried getting into ctags before.

    but for developing N++ plugins or maybe a multi-file Perl module (e.g., Win32::Mechanize::NotepadPlusPlus) it’s pretty helpful.

    That’s the personal project I’ll probably use it the most in. And my upcoming work project will involve a multi-file CPP program – I’ll mostly be in the IDE bundled with the hardware that the program will be running on, but when I’m at my desk, I’ll probably do “quick” edits in Notepad++, so ctags/TagLEET will probably help there, too.

  • trying to figure out

    3
    0 Votes
    3 Posts
    234 Views
    Michael VincentM

    @Kerry-Down

    @Alan-Kilborn beat me to it!!!

    Try adding the XML Tools from Plugins Admin (Plugins => Plugins Admin…).

    Once installed, Plugins => XML Tools has lots of options to look at including “Check XML Syntax now”, “Validate Now” …

    Cheers.

  • Tab settings not saving settings for "use default value"

    15
    0 Votes
    15 Posts
    2k Views
    Daniel FuchsD

    Removing config.xml fixed the issue on my work computer.

  • // Javascript files don't show even background in ver. 7.7 //

    12
    0 Votes
    12 Posts
    653 Views
    PeterJonesP

    @Ricardo-E-Trelles-0 ,

    If you don’t like the background, change the default background. I’ve pointed you to the setting multiple times.

  • How to remove characters () and text inside

    7
    0 Votes
    7 Posts
    3k Views
    DrewD

    @PeterJones

    Thank you so much! Yes it works.
    I chose to find: (<tag>.*)\(.*\)(</tag>)
    And replace with: \1\2 or $1$2
    Checkmark regular expressions

  • find and replace find numeric value and replace

    2
    0 Votes
    2 Posts
    278 Views
    PeterJonesP

    @Venkat-Ramani ,

    You will have to re-phrase with a complete question. You appear to want to replace something with something else, but do not do a good job with explaining the before and after. Please read the boilerplate I am attaching, as it will help you understand how to better ask the question and better format the question, plus link to documentation that will help you learn how to figure this out yourself.

    If you show a willingness to learn, and to help us help you, by replying in a way that shows you read and understood my recommendations below, you are likely to get good help. Otherwise, I wish you the best of luck.

    ----

    Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as plain text using the </> toolbar button or manual Markdown syntax; screenshots can be pasted from the clipboard to your post using Ctrl+V. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get… Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.

  • replace some text inside the quotes

    9
    0 Votes
    9 Posts
    3k Views
    guy038G

    Hello, @vivianjenylord and All,

    Some explanations on this regex S/R :

    The part \.\w+ searches a literal dot character, followed with a non-null range of word chars…

    But ONLY IF  the condition inside the look-ahead is True. That is to say if, further on, in current line, a colon followed with a second non-null range of word chars, stored as group1 as embedded in parentheses, can be found

    In replacement, we rewrite a dot, followed with the contents of group1 ( the country name )

    Cheers,

    guy038

  • Something got changed, how do I revert it

    13
    0 Votes
    13 Posts
    1k Views
    EkopalypseE

    @romanml71 said in Something got changed, how do I revert it:

    However, not all plugins are in both places. nppcalc.dll was only in C:\ProgramFiles(x86)…

    I guess this could be if some older installation was updated with a much newer version.
    My understand it is that as long as Local Conf mode : OFF is set,
    the configuration, plugins … will be read from %APPDATA% and in case
    of Local Conf mode : ON npp is looking to the directories next to its executable.

  • file open/save as menus always are full screen version

    2
    0 Votes
    2 Posts
    574 Views
    EkopalypseE

    @Douglas-Kaynor

    Normally a double click in the title bar should restore it to be able to resize it.

  • explorer.dll. The specified module could not be found.

    34
    0 Votes
    34 Posts
    4k Views
    Carlos ZhangC

    @Carlos-Zhang said in explorer.dll. The specified module could not be found.:

    Plugins > Open Plugins Folder: Nothing happened. File Manager did not open.

    I also fixed this by this page:
    https://support.microsoft.com/en-us/help/929833/use-the-system-file-checker-tool-to-repair-missing-or-corrupted-system
    FYI.

  • I want to cut a specific range

    6
    0 Votes
    6 Posts
    4k Views
    guy038G

    Hello, @김성찬 and All,

    An other and easy solution is to use the Begin/End Select feature !

    1 Left click at the very beginning of the first line 0000 90 9F 33 .. .. .., to move the caret to this location

    2 Select the option Edit > Begin/End Select

    3 Use the Ctrl + End shortcut to get the very end of your hexadecimal dump text

    4 Press and hold down the ALT key and left click after the 16th hexadecimal byte of the last line

    5 Select, again, the option Edit > Begin/End Select

    => After a while, needed to process 400,000 lines about, as you said, you should notice this big rectangular selection !

    6 Simply, press the Delete key

    Voila :-))

    Best Regards,

    guy038

    P.S. :

    If you forget to hold down the ALT key, at step 4 of the method above, you, obviously, get a normal selection of all your text !

  • Syncing unread files between cloud synced devices

    6
    0 Votes
    6 Posts
    2k Views
    EkopalypseE

    @PeterJones

    f355847c-96d5-416f-9554-5fdb80611ff0-image.png