• Copy, search and replace between 2 HTML files

    15
    0 Votes
    15 Posts
    993 Views
    Kosmos HuynhK

    Dear @guy038 ,

    I got the solution by correct quotations as the followings:

    gawk ‘BEGIN {n=0} NF {print > “File_“n”.txt”} !NF {n++}’ File_A.txt

    Best regards,
    Kosmos.

  • Bulk editing in Notepad ++ program?

    4
    0 Votes
    4 Posts
    5k Views
    PeterJonesP

    @darkenb ,

    I asked for text, you gave an image. I asked for “before” and “after” data separately; you put the “before” and “after” in the same screenshot – and even on second reading, I didn’t realize that the to in your image was the change from X to Y indicator rather than part of your text.

    The rest of what I wrote is to help you learn and to help you get better help. The help you receive will only be as good as the effort you put into asking for help.

    For your actual problem:

    FIND = <category>TEXT (\d)</category> REPLACE = <category>TEXT $1$1</category> Search Mode = regular expression

    (untested)

    I recommend you backup any files you try this on, and only try it on one file until everything is working.

    There are obvious assumptions in my example – that your text is literally TEXT every time, and that you’ll always only have one digit after text before </category> – but if my answer is not sufficient for your needs, you are going to have to do a better job of providing data that represents your data, and showing a willingness to learn.

  • Applying multiple commands on folder

    4
    0 Votes
    4 Posts
    339 Views
    Alan KilbornA

    @Anass-Chawki

    like running multiple shortcuts at a time

    Ah, you mean like multi-threading? I’m afraid not.

  • UDL Operators - unicode support?

    3
    0 Votes
    3 Posts
    417 Views
    moon6969M

    @PeterJones Thanks.
    I was hoping to use operators since they “glue” - my initial testing indicates that keywords need spaces to be recognised which is difficult to ensure in my case.

    I’ll check out the suggested script - might be a quick win if it’s fast enough on some of the decrepit hardware I need to support!

  • What ever happened to the plugin manager?

    2
    0 Votes
    2 Posts
    172 Views
    EkopalypseE

    @Kephri-13

    It was replaced by the Plugin Admin

  • Text Blocks without end

    5
    0 Votes
    5 Posts
    1k Views
    RailienR

    Thank you PeterJones,

    that’s it.
    I’ve even tried that, but somehow did’t see the functionality.

  • 1 Votes
    11 Posts
    2k Views
    EkopalypseE

    @MK-Digital
    Whether it is in appdata or not depends on how you installed npp and
    whether you are using the doLocalConf.xml or not.

  • I have problem

    2
    0 Votes
    2 Posts
    137 Views
    PeterJonesP

    @Abdul-Basit ,

    This FAQ might help you get started. Good luck.

  • Please help me a with a regex replacement formula

    12
    0 Votes
    12 Posts
    632 Views
    Mantelis TelisM

    @guy038 hello :)

    okay first since I tried to replace tabulation character - \t - but the notepad++ does not register the find so I had to leave it as it was.

    Regarding the remark - its okay the stuff I’m fixing is not in English language so I simply translated this small part to english in case it would be easier to understand for everyone though it bears no meaning withtout more context. :)

    I think this thing worked for me in the end. I see no errors on the database so far.

    Will get into youtube video code embedding replacement next which is a bit different than this query. Will ask for help later. :) Thanks for everybody involved.

  • Crashing when accessing Files browser

    2
    0 Votes
    2 Posts
    571 Views
    cmeriauxC

    @IgnorantKnight debug info please ?
    Try out with latest version
    Try out with portable version
    Try out without plugins

  • convert lower to upper and upper to lower aftert colon

    12
    1 Votes
    12 Posts
    2k Views
    guy038G

    Hi, @real_1bx, and All,

    This time, due to the simultaneous search of an entire line, with its line-break, when a digit follows the colon char, we need, again, two groups, leading up to that regex S/R :

    SEARCH (?-is)^.+:\d.+\R|((:[A-Z])|:[a-z])

    REPLACE ?1(?2\L:\U)\1

    For instance, the input text, below :

    john:abC232 john:13kkmsd smith:SnLf1999

    would be modified as :

    john:AbC232 smith:snLf1999

    Best regards,

    guy038

  • Delete all duplicates words in the text

    3
    0 Votes
    3 Posts
    799 Views
    guy038G

    Hi, @сергій-бородін and All,

    Thinking back on your problem, here is a second method, requiring fewer steps, but which will classify each non-duplicated tag, according to a different layout !

    So, assuming the same initial text, below :

    filename1.eps,tag1;tag2;tag3 filename2.eps,tag4;tag1;tag5 filename3.eps,tag6;tag2;tag9 filename3.eps,tag7;tag2;tag3;tag8 filename4.eps,tag1;tag9;tag5 filename5.eps,tag4;tag6;tag10;tag12 filename5.eps,tag8;tag2;tag1;tag6;tag11 filename6.eps,tag3;tag2;tag3;tag10;tag14 filename7.eps,tag5;tag7;tag15 filename8.eps,tag4;tag5;tag15;tag16 filename8.eps,tag3;tag14;tag9;tag7 filename8.eps,tag7;tag2;tag3;tag8 filename9.eps,tag2;tag10;tag17 filename10.eps,tag5;tag1;tag13 filename10.eps,tag7;tag6;tag9;tag10 filename11.eps,tag7;tag2;tag3;tag8;tag18 filename11.eps,tag10;tag12;tag13;tag20 filename12.eps,tag4;tag8;tag3;tag19 filename13.eps,tag6;tag15;tag9;tag11 filename14.eps,tag7;tag2;tag3;tag17;tag12;tag4 filename15.eps,tag0;tag9,tag20

    First this simple regex S/R, changes all this list in a one-line list :

    Open the Replace dialog ( Ctrl + H )

    SEARCH \R

    REPLACE # ( Any symbol, not used yet, can be chosen )

    Select the Regular expression search mode

    Click on the Replace All button

    Which gives the single line, below :

    filename1.eps,tag1;tag2;tag3#filename2.eps,tag4;tag1;tag5#filename3.eps,tag6;tag2;tag9#filename3.eps,tag7;tag2;tag3;tag8#filename4.eps,tag1;tag9;tag5#filename5.eps,tag4;tag6;tag10;tag12#filename5.eps,tag8;tag2;tag1;tag6;tag11#filename6.eps,tag3;tag2;tag3;tag10;tag14#filename7.eps,tag5;tag7;tag15#filename8.eps,tag4;tag5;tag15;tag16#filename8.eps,tag3;tag14;tag9;tag7#filename8.eps,tag7;tag2;tag3;tag8#filename9.eps,tag2;tag10;tag17#filename10.eps,tag5;tag1;tag13#filename10.eps,tag7;tag6;tag9;tag10#filename11.eps,tag7;tag2;tag3;tag8;tag18#filename11.eps,tag10;tag12;tag13;tag20#filename12.eps,tag4;tag8;tag3;tag19#filename13.eps,tag6;tag15;tag9;tag11#filename14.eps,tag7;tag2;tag3;tag17;tag12;tag4#filename15.eps,tag0;tag9,tag20

    Now, here is the regex S/R, which deletes any duplicated tag ( The same regex, described in my previous post ) :

    SEARCH (?-is)[,;](\w+)(?=[,;#].*?[,;]\1([,;#]|\R|\z))

    REPLACE Leave the zone EMPTY

    Your text should be shortened as below :

    filename1.eps#filename2.eps#filename3.eps#filename3.eps#filename4.eps#filename5.eps#filename5.eps#filename6.eps#filename7.eps#filename8.eps;tag16#filename8.eps;tag14#filename8.eps#filename9.eps#filename10.eps,tag5;tag1#filename10.eps#filename11.eps;tag18#filename11.eps,tag10;tag13#filename12.eps;tag8;tag19#filename13.eps,tag6;tag15;tag11#filename14.eps,tag7;tag2;tag3;tag17;tag12;tag4#filename15.eps,tag0;tag9,tag20

    Finally, this regex S/R, below :

    Replaces any semi-colon, right after the string eps with a comma

    Replaces any # symbol with a line-break ( \r\n or \n )

    SEARCH eps;|(#)

    REPLACE ?1\r\n:eps,    OR    ?1\n:eps, if you works with an Unix file

    And we obtain the final output :

    filename1.eps filename2.eps filename3.eps filename3.eps filename4.eps filename5.eps filename5.eps filename6.eps filename7.eps filename8.eps,tag16 filename8.eps,tag14 filename8.eps filename9.eps filename10.eps,tag5;tag1 filename10.eps filename11.eps,tag18 filename11.eps,tag10;tag13 filename12.eps,tag8;tag19 filename13.eps,tag6;tag15;tag11 filename14.eps,tag7;tag2;tag3;tag17;tag12;tag4 filename15.eps,tag0;tag9,tag20

    As you can see, the 21 non-duplicated tags ( From tag0 to tag20 ) are arranged differently, with many lines without tag, at beginning of the list !

    Best Regards,

    guy038

  • Function list for user defined language

    7
    0 Votes
    7 Posts
    2k Views
    MAPJe71M

    Maybe FAQ Desk: Function List Basics will give you some ideas.

  • File Type issue

    6
    0 Votes
    6 Posts
    4k Views
    RunkelikunkkuR

    @Jeffrey-Snively said in File Type issue:

    Now I have a different problem. With some file types (including .txt), when I go Right-click>Open With>Choose Default Program, it gives me the option to select NPP. I select it and check the “Always use this program” box. Then when I look in Windows explorer, it shows the file type for all my .txt documents as “Notepad++ Document” instead of “.txt file” or something.

    Old thread but I had same issue and this was the top google result so maybe this will help someone in future. Open regedit, go to “HKEY_CLASSES_ROOT\Notepad++_file”, instead of “Notepad++ Document” leave the description empty and reboot your PC. Thanks for someone over at SU providing this.

  • I need help to remove a string

    3
    0 Votes
    3 Posts
    270 Views
    PeterJonesP

    On re-reading, I saw a fine point I may have missed: if you only want to delete parenthesized items when it starts with (tstamp, then slight change:

    FIND = \(tstamp.*?\)

    The rest remains the same.

    With this,

    (blah keep this) (tstamp blah blah) (blah keep this)

    will become

    (blah keep this) (blah keep this)

    If you have more requirements (the paren must start at the beginning of the line and/or end at the end of the line, or other such modifications), those refined requirements can be met. However, you will need to be more explicit.

    ----

    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 clipbpard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. 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.

  • Removing punctuation before a line

    13
    0 Votes
    13 Posts
    2k Views
    УменяМодем ОграниченныйТрафикУ

    Yes, everything worked out, thank you!
    The first time I didn’t understand anything… the second time I didn’t notice my mistake…
    And the third time you read that I understood everything! :)

  • "new 1" never goes away

    6
    0 Votes
    6 Posts
    518 Views
    Paul RoubekasP

    Don’t have permission to change or delete the file. I have reached out to someone who does to make the change. It may take a day or two.

    Thanks for the help. :-)

  • Delete unwanted characters

    2
    0 Votes
    2 Posts
    241 Views
    EkopalypseE

    @Zara-Arik

    First of all thanks for the examples.
    We can see that you have made an effort to explain your goals.
    Unfortunately, at least for me, the explanations are confusing, so I don’t really understand what you want to do.
    Obviously, like me, English is not your first language, so I would recommend that you use an Online Translator to help you.
    Please note, the better/precise the question in your mother tongue is set, the better the translation will be.

    To the questions:

    Use the find dialog, go to the Mark Tab and mark the hits, optionally set bookmarks for each line

    Probably a regex search for \(.+?\) could provide this.

    How do you know if a sentence begins or ends. For this you actually need an AI that was really programmed for it and even this one won’t work 100%

    and 5. I do not understand.

    Translated with www.DeepL.com/Translator (free version)

  • How to create a remove "Search Mode: Regular expression"

    20
    0 Votes
    20 Posts
    1k Views
    redorbroderR

    @PeterJones
    Thanks for your help and info.
    I’ll just leave the accounts as they are, don’t want to mess things up…
    This account will be the one I use from now on.

    Best regards,
    Red

  • Trying to completely remove notepad++

    4
    0 Votes
    4 Posts
    11k Views
    Metin BatM

    hi, first of all i had a similar problem and it took a long time to solve the problem. as a result, I solved the problem completely and the steps should be as follows; First, you should uninstall Notepad ++ from the program manager, then open the file manager and select the option to show hidden files, folders and drives again in the window with the options> options> folder. then say okay close the windows. Open this computer window and search by typing Notepad ++ in the search box. after doing all these, run the registry editor searching CTRL + S Regedit, close all open folders, click on the computer and open the search window with the combination of CTRL + F Search the name Notepad ++ and delete the found files. Use the find next option to find and delete all, then restart your computer. Download notepad ++ x86.exe and x64.exe, then install the first x86. disable run when finished setup. then install the x64 version without running anything. When installation is finished run and close notepad ++. then reload the x86 version and all settings will be reset.