• Highlight brace after caret instead of before

    Locked
    1
    0 Votes
    1 Posts
    503 Views
    No one has replied
  • EXTRACT COLUMNS WITH NOTEPAD

    Locked
    5
    0 Votes
    5 Posts
    3k Views
    guy038G

    Hi, @sakijhon, @Terry-R and All,

    I understood why I wrongly supposed that it could be some spaces, at end of fields. Just because, analyzing the initial OP’s lines, with the TextFX option Line up multiple lines by (Clipboard Character), the plugin added some space chars to get all : separators aligned. And somehow, I probably used pieces of text containing these blank chars :-((

    So, Terry, you’re right and, probably, blank characters do not exist before or after semicolons, in the OP’s text. Thus, the search regex can be simplified as below. Note, also, that the replacement remain unchanged :-))

    SEARCH (?-s)^(.+?:){6}((.+?):){3}.+

    REPLACE \1\3

    Wow ! We just have learned a useful rule, regarding delimiter-separated format files :-))

    Let’s imagine, for instance, a file, containing, exactly, 12 fields, with the ! exclamation mark as a delimiter char.

    Now, let’s suppose that you would extract the 3rd, 5th, 6th and 11th fields, only, from that file

    So, we start with this sample text :

    3.00000!0.0009900000!S!{0}!frankgotti@me.com!frankie!Tucson!456789!student!marketing!approved!last field, line 1 3.50000!0.3010299957!C!{2}!chary@hotmail.com!charoty!!orth_Oracle!567234!notstudent!mathematics!disapproved!last field, line 2 3.75000!0.6020500913!S!{2}!tytarty@yagoo.com!tiagonne!Mission_District!126789!teacher!course_algebra!teacher!last field, line 3

    We, first do simple subtractions in order to determine all the coefficients, used as quantifiers, in the regex :

    Fld | Qtf 3 - 0 = 3 \ 5 - 3 = 2 \ 6 - 5 = 1 \ 11 - 6 = 5

    This leads to these correct regexes :

    SEARCH (?-s)^(.+?!){3}(.+?!){2}(.+?!)((.+?)!){5}.+

    REPLACE \1\2\3\5

    OR

    SEARCH (?-s)^(.+?!){3}(.+?!){2}(.+?!)(?:(.+?)!){5}.+

    REPLACE \1\2\3\4

    And… we get the expected results :

    S!frankgotti@me.com!frankie!approved C!chary@hotmail.com!charoty!disapproved S!tytarty@yagoo.com!tiagonne!teacher

    Et voilà !

    Cheers,

    guy038

    P.S. :

    In case of unwanted space characters, right before or after any separator, it is more sensible to do the preliminary S/R, below :

    SEARCH \x20+Separator\x20+

    REPLACE Separator

  • Hide/Remove the "close all" button top left in the toolbar?

    Locked
    8
    0 Votes
    8 Posts
    2k Views
    Scott SumnerS

    @Serpens66 said:

    that was not what I asked

    Ah, I see that now. It was my misunderstanding that you were trying to press the Close toolbar button but were hitting the Close All toolbar button instead. Sorry for that, I guess I read your original posting too quickly.

    But, really, if you are going to accidentally hit a toolbar button rather than a file-buffer’s tab (something I have never accidentally done), then perhaps you should simply turn the toolbar OFF as it sounds like you are in peril of accidentally activating ANY toolbar function and not only the Close All one. Turning off the toolbar can be done in the preferences.

  • What's triggering "move to other view" cursor?

    Locked
    6
    0 Votes
    6 Posts
    1k Views
    Terry RT

    @Scott-Robertson
    Thank you for updating the situation. Now I also know something new about NPP.

    Terry

  • Command "Edit with Notepad++" does not work in admin mode

    Locked
    2
    0 Votes
    2 Posts
    761 Views
    dinkumoilD

    This is not the right place to report a bug, you should follow this FAQ Desk entry to do that.

    What I can tell you is that there is a plugin called SaveAsAdmin which, when installed, lets you store files even at locations protected by the OS. The plugin is obtainable via Plugin Manager (Notepad++ prior to v7.6) and Plugin Admin (Notepad++ v7.6 and higher).

  • 0 Votes
    19 Posts
    3k Views
    Scott SumnerS

    @Neculai-I.-Fantanaru

    So the premise from the beginning it seems has been that the need is for some few number of pairs of files; mentioning that you had something like 500 would probably have been a good thing to do early on. :-)

    Do you have a plan for how to combine the pairs of files into one file with the line of --------- separating them? That seems key to the solution described thus far. There are some not-so-difficult ways, but specifying WHICH files and making sure there are the same number of lines in each…I don’t know, but I hope you do, as this is your problem and your data. Perhaps the regular expression can be altered to avoid the dependency on “n”, but unless you have solutions for some of the other technical difficulties, well, then…

    It seems we are getting very close to advising you that you need a programming language to do this more easily.

    And yes, people, I do realize this discussion is getting a bit outside the realm of Notepad++ discussion. :-)

  • 0 Votes
    4 Posts
    1k Views
    dinkumoilD

    Search for: ([.:=*]) +
    Replace with: \1\r\n

  • Replace comma in text between quotes

    Locked
    3
    0 Votes
    3 Posts
    3k Views
    Terry RT

    @Stephen-Yorke
    I have now created a regex that will only target commas (,) outside of quoted fields.
    So we have (use search mode as regular expression and wraparound ticked).
    Find What:,\h*(?![^,]+”)
    Replace With:| <----- note there is a space after the | character. This is to put a space after every |.

    After running that you then can remove all quotes. I haven’t given you the regex for that, I will leave that for you to do, it is a very easy one to create.

    Give it a go and let us know if it suits your needs. Although your 4th field is quoted, this will work on leaving ANY field alone if quoted.

    Terry

  • Is it possible to search and replace text without touching html tags?

    3
    0 Votes
    3 Posts
    927 Views
    alfredodo1A

    Hi guy038 you really rock thank you so much for your help, that’s very kind from you. Your solution works wonder, thanks for this very detailed help !

  • Yaml double quotes

    Locked
    5
    0 Votes
    5 Posts
    2k Views
    Axonn EchysttasA

    @guy038 G’dam’ m’man! That’s a niiiiice find. Thank thee! :D. Much obliged’n’all :). And if you wonder why I wrote “G’dam’ m’man!” that way, just listen to https://open.spotify.com/track/1jGvgQkqQtNVj725vg26Ft (it’s an anti-racist song :) ).

  • Changing from Default Style causes printing of blank pages

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    PeterJonesP

    … for example, I took a document I happened to have open, printed it to PDF using PDFCreator, and it was fine. I then changed to “VIM Dark Blue” theme, and printed to PDF, and it was still fine.

    Debug Info =

    Notepad++ v7.5.8 (32-bit) Build time : Jul 23 2018 - 02:03:53 Path : C:\Program Files (x86)\Notepad++\notepad++.exe Admin mode : OFF Local Conf mode : OFF OS : Windows 10 (64-bit) Plugins : ComparePlugin.dll dbgpPlugin.dll DSpellCheck.dll MarkdownViewerPlusPlus.dll NppConverter.dll NppExec.dll NppFTP.dll PluginManager.dll PreviewHTML.dll PythonScript.dll XMLTools.dll mimeTools.dll NppExport.dll
  • Automatic rename of text file to current date

    15
    1 Votes
    15 Posts
    5k Views
    Scott SumnerS

    @NuclearBinoculars said:

    I DID mean to have a reverse slash…For some reason it did not show up

    The reason is that you did not put your text inside proper delimiters (the ones that turn text shown here into a red-on-pinkish background, for example). If you had, it would not have consumed your backslashes. But with your most recent posting you seem to have mastered the delimiters technique, so I’ll say no more… :-)

  • Remove empty lines and timestamp from subtitle file in Notepad++

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Adrian WoodsA

    Thank you very much

  • regex to conditionally delete unnecessary lines in .csv files?

    Locked
    5
    0 Votes
    5 Posts
    2k Views
    Scott SumnerS

    @Brandon-Tibbitts

    You can’t do arithmetic in this (regex) manner. You’re going to need a programming language for that, or perhaps, since you appear to have .csv files, pulling the data into Excel to do the math would work. Good luck.

  • Replacing string involving two lines ?

    Locked
    8
    0 Votes
    8 Posts
    1k Views
    guy038G

    Hello, @terry-grafff, and All,

    Oh, unfortunately, how right you are ! All these advert breaks, pre and post-shows are really a calamity :-((( On French TV, as everywhere else I suppose, they tend to increase, year after year !

    We still have, on Net, the possibility to just get, on very few sites, the Knowledge, but for how long ?

    Cheers,

    guy038

  • 0 Votes
    9 Posts
    2k Views
    dinkumoilD

    @Scott-Sumner

    Ahh, much more innocent. ;-)

  • 0 Votes
    6 Posts
    2k Views
    PeterJonesP

    extra: in case you’re curious, since the OP used %L but my example used %1: see this post for a link describing %1 vs %L in registry entries. In short: it doesn’t really matter in this case, because the difference is only significant on old 16bit windows OS (like Win3.11). On modern Windows, %L and %1 are interchangeable in the registry associations. (Only %1 works in .bat/.cmd files, though, which is why I’ve gotten used to using %1.)

  • HTML <a download> not working

    Locked
    1
    0 Votes
    1 Posts
    571 Views
    No one has replied
  • js file not loading

    Locked
    2
    0 Votes
    2 Posts
    538 Views
  • 0 Votes
    3 Posts
    1k Views
    Meta ChuhM

    @Danilo-Schembri

    your regex works for me

    Find: ([A-Z]) ([A-Z])
    Replace: \1_\2
    `Search Mode: Regular Expression

    gives me

    FIELD_ONE
    FIELD_TWO
    FIELD_THREE

    if i press replace all (or repeatedly press replace)

    @guy038
    i think you ment:
    REPLACE \1\x5F\2 instead of REPLACE \1\x20\2