• Remove last word of each line

    9
    0 Votes
    9 Posts
    2k Views
    Lycan ThropeL

    @Terry-R ,
    Thanks, and you’re right, I learn more, by trying. I had started to use regex101.com, but for the reason you mention, some of the boost stuff throws an error in it. I think I may have used a bad character or something when it threw the error, so I went to the NPP S/R box to try out what I had. Thanks for the reasoning behind the failure. I had tried a \h, but that failed also, so…at least I have another tool in the box to understand the next time I try. :)

  • how to change email and pass to email:pass

    5
    0 Votes
    5 Posts
    3k Views
    guy038G

    Hello, @bahaa-eddin-ツ, @peterjones and All,

    The solution already provided by @peterjones is the right one and my solution would be identical or very similar !

    Best Regards,

    guy038

  • How to enable multi edit?

    3
    0 Votes
    3 Posts
    213 Views
    Bahaa0013B

    @PeterJones
    feeling idiot…
    thanks again Peter

  • sudo notepad-plus-plus (in Linux of course)

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP

    @Dave92F1,

    I was hoping the NP++ community would have experience with this, since I gather that NP++_on_Wine is sort of the “official” way to run NP++ on Linux.

    Notepad++ is an application for Windows ; no other usage is official nor even “official”. If you can get it to work in another environment (like Wine), then lucky you.

    Elsewhere I’ve been advised that “the only way” to do this is to take ownership of the file, edit it, then restore ownership back to root. I’m not sure if that’s practical (I’d have to find a way to do it in a script).

    I am not a linux-sudo expert, but the sudo permissions should be sufficient to run a script that changes the owner of a file, makes a change, then changes it back – at least, I cannot imagine how that wouldn’t work, since root (and thus sudo) has the ability to change permissions on any file. I mean, if I’ve understood correctly, the script could probably be as simple as

    sudo chown username /etc/rc.local notepad-plus-plus /etc/rc.local sudo chown root /etc/rc.local

    Do not take my word as “golden” or “authoritative” or “official” on this. I’ve never done such a thing. And there are probably security implications of changing the owner, even temporarily.

    ----
    edit: Ooh, another idea: copy it to a temp file before changing permission, so no one else ever has permission on the real file

    sudo cp /etc/rc.local /tmp/editable.rc.local sudo chown username /tmp/editable.rc.local notepad-plus-plus /tmp/editable.rc.local sudo chown root /tmp/editable.rc.local cp /tmp/editable.rc.local /etc/rc.local

    That might be better, though there are probably still security considerations on that. Using a meaningless/random tmpfile name would probably be better than /tmp/editable.rc.local, so that it’s not obvious to an outsider watching the /tmp filestructure that the file is being used for editing rc.local

  • Can't move over sessions

    7
    0 Votes
    7 Posts
    2k Views
    John HinzJ

    @PeterJones

    I figured it out thanks to your help. Your previous mentioned the file path the sessions file was referencing. On my old computer my username was “user” while on my new computer its “John” The session file has “user” referenced and not "John so I simply made a new directory where the session file was referencing that had my old notepad++ folder. That seemed to do the trick. Thanks again for pointing me in the right direction.

  • How to get specific position in Notepad++

    2
    0 Votes
    2 Posts
    1k Views
    EkopalypseE

    @Sheba-Sam

    I am not sure what you mean by result to be displayed.
    Result of which action? And where does e08 come from?
    And what does it mean in this context?

  • Why is my synchronize vertical and horizontal scrolling disabled?

    8
    0 Votes
    8 Posts
    4k Views
    PeterJonesP

    @W-TX said in Why is my synchronize vertical and horizontal scrolling disabled?:

    If Notepad++ is closed with 2 views, restart Notepad++ with 2 views, both synchronize-vertical and horizontal scrolling is disabled.

    Yes, that’s exactly the situation described in the issue#5250 that @Alan-Kilborn already linked you to. And it’s what he specifically described as the long-standing problem in the follow-on message a few hours ago:

    you have 2 views open when exiting Notepad++, and when you restart Notepad++ you still have 2 views showing but the “synchronize” menu choices are now disabled – as I mentioned, a long-standing problem.

    He tried multiple times to tell you that was a known bug.

  • Can I search among several xlsx files?

    5
    0 Votes
    5 Posts
    2k Views
    Mark OlsonM

    The Excel grepper tool is done. See https://github.com/molsonkiko/excel_grepper_npp.

  • francostellari Plugin Zip files will not unzip

    3
    0 Votes
    3 Posts
    317 Views
    Mojo RisingM

    @PeterJones Thanks Peter

    That seems to be the issue

    It is strange that the right-click download action generates a file with a .zip extension instead of .htm or something

    Anyway I have got the zip open now. Thanks

  • cannot find starterPage.html

    2
    0 Votes
    2 Posts
    148 Views
    PeterJonesP

    @Evan-Smith ,

    Notepad++, like most applications, uses the Windows builtin File Open interface. So you navigate through your hard drive just like you would on any other application.

    If you do not know how to search your hard drive for a given filename, I suggest asking your favorite Search Engine that Knows All how to search a Windows machine for a given filename, since that’s a Windows question, not a Notepad++ question.

  • CURRENT_WORD not selecting the proper text when used in column mode

    10
    1 Votes
    10 Posts
    549 Views
    Alan KilbornA

    @Howie-Thurer said in CURRENT_WORD not selecting the proper text when used in column mode:

    I think I need to focus on the Python Script Plugin to accomplish what I’m trying to do.

    Yes.

    It is OK that you have regular Python now, and the NppExec plugin. Both are “good to haves”. But they don’t help for what you are trying to do. NppExec perhaps could be of some help (I don’t know it that well), but with PythonScript you are definitely now on the fast track.

    As a kickstarter for one of the things you need to do, you probably want to make sure you have a selection when you run your (future) script:

    if not editor.getSelectionEmpty():

    If you demand a column-block selection, then verify that with:

    if editor.getSelectionMode() == SELECTIONMODE.RECTANGLE:

    You probably want to retrieve the selected text:

    text_of_col_block= editor.getSelText()

    If you want/need, get the column block into a list of the text on each individual line:

    sel_text_on_each_line_list = text_of_col_block.splitlines()

    …maybe enough of a kickstarter for now…

    But here’s another one for the second part of what you’re doing, IF you want to keep the “macro” approach; here’s a valid PythonScript syntax:

    notepad.runMenuCommand('Macro', 'Your Macro Name')

  • move columns to rows w semicolon separator

    3
    0 Votes
    3 Posts
    664 Views
    PeterJonesP

    @bry-can

    It looks like you probably have the dir output from cmd.exe environment. If you had read the “Please Read Before Posting” and the Search/Replace FAQ it references, it would have been easier for us to be sure, rather than guessing. Also note: including data in your AFTER that wasn’t in your BEFORE is really confusing. And showing a screenshot from a spreadsheet program when you are asking for help with Notepad++ isn’t very helpful, either.

    Given it’s your first post, and you at least tried to provide BEFORE and AFTER data, I will take pity on you. But in the future, we will expect you to put in more effort to format your posts to be more readable. The FAQs linked at the bottom of my post will help you.

    Normally, I would tackle something like this is in my favorite programming language (and I actually wouldn’t parse the dir output; I’d navigate the directories from inside the programming language).

    However, if you insist on doing it in Notepad++ with Regular Expressions, it’s possible, especially if you are willing to do a multi-step process (all of which assume Search Mode is Regular Expression mode):

    Remove all leading spaces:
    FIND = ^\h*
    REPLACE = (ensure the box the box empty) Remove the blank line between “Directory” and the actual listing
    FIND = (?-s)^(Directory.*\R)\R
    REPLACE = $1 format the lines starting with dates
    FIND = (?-s)^(\d\d/\d\d/\d\d\d\d)\h*(\d\d:\d\d [AP]M)\h*(\d[\d,]*)\h*(.*)$
    REPLACE = ;$1;$2;$3;$4 move the summary line to the end of each block’s first ;-starting line. This one uses some pretty fancy tricks
    FIND = (?-s)^Directory.*\R;.*\K(\R(?:^;.*\R)*)(\d+ File.s.)\h+(.*)\R*
    REPLACE = ;$2;$3$1 combine the “Directory” line with the first ;-line below:
    FIND = (?-s)^(Directory.*)\R
    REPLACE = $1;

    AFTER

    Directory of e:\banana\AFFACT\AA Director;;06/19/2007;06:26 AM;239,616;AA Sexual Harassment Survey.mdb;2 File(s);538,624 bytes ;04/09/2008;10:13 AM;299,008;AASexualHarassmentPrevSurvey.mdb Directory of e:\banana\AFFACT\AA PLANS\AA PLAN 1999-2000;;09/26/2005;10:26 AM;21,460,992;bkruk.mdb;1 File(s);21,460,992 bytes Directory of e:\banana\AFFACT\AA PLANS\AA PLAN 2000-2001;;02/09/2006;11:36 AM;21,504,000;bkruk.mdb;1 File(s);21,504,000 bytes Directory of e:\apple\AFFACT\AA PLANS\AA PLAN 2001-2002\AA PLAN 2001 - 2002;;12/16/2002;09:41 AM;21,499,904;bkruk.mdb;1 File(s);21,499,904 bytes Directory of e:\orange\AFFACT\AA PLANS\AA PLAN 2002-2003\AA PLAN 2002 - 2003;;09/26/2005;10:42 AM;21,549,056;bkruk.mdb;1 File(s);21,549,056 bytes

    You can record that sequence as a macro and save it with a name and keyboard shortcut if you’re going to be doing this a lot. (If you do, please note that my sequence assumes you don’t have any <DIR> directory entries, and that it doesn’t show the “# Dir(s)” line after the “# File(s)” line, both of which are weird assumptions given the default output of dir, but match your shown data)

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • Add line break before any number

    2
    0 Votes
    2 Posts
    1k Views
    PeterJonesP

    @Mike-Atnip ,

    In regular expression mode, putting \r\n in the replacement will add in a CRLF newline sequence (the normal Windows line ending)

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • minimized window closes Npp, why ? ( is a bug or malware of OS ? )

    3
    0 Votes
    3 Posts
    254 Views
    Speedy ConsolasS

    Sorry my invalid feedback, I am found the option that the editor is being minimized to system tray instead of close. i.e. no problems on minimizing ! Opened files will NOT closed in the editor minimized to the taskbar.

  • Replacing/Translating multi string values to other international language

    7
    2 Votes
    7 Posts
    1k Views
    Alan KilbornA

    @Faseeh-Shah said in Replacing/Translating multi string values to other international language:

    Luckily I found solution, a script.

    If that’s what you were looking for, you shouldn’t have asked your original question in a Notepad++ forum, as it is OFF-TOPIC.

    Here we only deal with what Notepad++ can do for you, and what you can do with it.

    In other words, your question must be related to Notepad++ in some way. Your question was NOT.

  • regex, lookbehind error

    5
    1 Votes
    5 Posts
    791 Views
    E

    @dinkumoil Thank you, actually I’m studying regex with 'Mastering Regex by Jeffrey Friedl and maybe I didn’t consider the differences on those engines.

  • Doing a line of 10 words and repeat

    3
    2 Votes
    3 Posts
    289 Views
    Dr HampusD

    @Alan-Kilborn

    That solved the problem. Thank you so much! :)

  • 0 Votes
    15 Posts
    3k Views
    Brian Crosby 0B

    @PeterJones

    Yeah, I finally was able to take some time and use the markup tutorial. The </> button was adding extra triple tick marks, then giving the “hint” that its for code; I don’t consider data code…

    Not sure who’s comment mentioned my use of REGEX101, but mostly I am using it as a way to break down the components of the REGEX to understand what each piece is doing. Something I tried to do also with my explanation of what I “think” each of my expressions was doing.

    Having someone offer a potential solution is awesome and I appreciate anyone that takes the time to help people, but often there is very little of the “why/what” breakdown that leaves me still scratching my head. Your breakdown on what was going where and why is what provided my mental breakthrough to grasp what was being offered.

  • Large File being truncated on Save!

    12
    0 Votes
    12 Posts
    4k Views
    ludamo 0L

    I just tried editing (adding 3 letters) the CSV file now and it worked OK with Notepad++ version 8.4.9. Initial file size was 9,138,779,797 bytes and after editing 9,138,779,800 bytes. It took about 2 minutes to load and then 2 minutes to save on my NUC 5i5.

  • Printer Configuration Issue

    3
    0 Votes
    3 Posts
    974 Views
    James A WilsonJ

    Thanks… That worked with no problem.