• Is it possible to run text through an external program?

    Locked
    3
    1 Votes
    3 Posts
    2k Views
    bcosellB

    @PeterJones Perfect… thanks very much!!

  • Showing the last line in a code fold. Possible?

    Locked
    2
    0 Votes
    2 Posts
    728 Views
    dailD

    Unfortunately it can not be done without significant C++ code changes.

  • 0 Votes
    3 Posts
    1k Views
    PeterJonesP

    Your subject line and the example are not specific enough, and possibly contradict each other:

    The subject says you want to remove all lines before the first : in the file if there are two :s in the file. That would say that

    first line second line hello : second : here

    would become

    hello : second : here

    But your example doesn’t seem to agree.

    Based on your example, I assume you want something like:

    hello:pig:cake hello;pig;cake -- note, this line is semicolons, not colons hello:pig:cake

    to become

    :pig:cake hello;pig;cake -- note, this line is semicolons, not colons :pig:cake

    Could you please give a bigger example document, showing us both the before and after? (To include your text verbatim, as I have, prefix every line in the text by 4 spaces, with a blank line before and after)

    Also, show what you tried.

    this faq will give you a good start on regular expressions.

    If you give a fuller explanation of what you want, and some indication that you’re willing to put in effort and learn, you’ll probably get one or more answers in short order. (Though it’s the weekend, so “short order” might be Monday. Ahh, @Terry-R showed up, so you might even get it sooner. Depends on who’s around when you clarify things.)

  • How do I search for non regular expression values?

    Locked
    2
    0 Votes
    2 Posts
    761 Views
    PeterJonesP

    Search > Find
    In the Find What, enter your regular expression.
    In the Search Mode section, enable the ☑ Regular Expression

  • 2 Votes
    4 Posts
    2k Views
    Oanh SchlesingerO

    I had this question too. Finding the answer was easy. I thought I was in for hours of searching. I looked at only one other place before coming to this one and to my surprise the question/answer was staring at me in the face. The entry outlining the steps was helpful indeed. Notepad++ transformed the way I do many things. I am just now learning and already understand it’s value. Keep up the good work. My performance is based on the knowledge of others. Thanks!

  • 文件夹工作区 Folder as WorkSpace

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Double spacing when editing PHP

    3
    0 Votes
    3 Posts
    1k Views
    SullyPanda76clS

    don’t double space!, use tab!

  • Select links by double clicking them? (or a specific part of them?)

    Locked
    7
    2 Votes
    7 Posts
    2k Views
    Caribou AiléC

    It works perfectly, great!

    Thank you again!

  • Date and time

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP

    This old thread shows a PythonScript example which will insert it. You could then add that to the PythonScript menu items, and assign a shortcut to it using Settings > Shortcut Mapper

    (This stackoverflow answer has lots of good screenshots of the process, with a slightly different date format.)

  • reload all opened files

    Locked
    2
    2 Votes
    2 Posts
    2k Views
    Scott SumnerS

    @prasad-konnur

    A long-known trick, if you want to say Yes to Do you want to reload it? for ALL of the files (which in this case I presume you do)…is to hold down the Y key until all of the popups go away.

    This will likely leave you a string of undesired yyyyyyyyyyyy in one of your editor windows, but a simple Undo (ctrl+z) gets rid of those.

  • 0 Votes
    3 Posts
    832 Views
    Claudia FrankC

    @Angelique-Pugh

    ok, the logical font used is Ms Shell Dlg.
    You need to check the registry at

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version\FontSubstitutes

    to see it’s real font. At my system it is MS Sans Serif.
    To fix a broken font you could try to goto
    Control Panel\All Control Panel Items\Fonts\Font settings
    and press the resore default font settings button, if this doesn’t
    help try to reinstall it.

    Cheers
    Claudia

  • Issue: Default session is lost after using two sessions at one time

    5
    0 Votes
    5 Posts
    2k Views
  • How to highlight certain words by color?

    Locked
    4
    1 Votes
    4 Posts
    2k Views
    Claudia FrankC

    @Сергей-Копышев

    see here what could be done.

    Cheers
    Claudia

  • UDL Folding Fail -Help Please

    Locked
    2
    0 Votes
    2 Posts
    668 Views
    Scott K. SmithS

    After several days hacking away at this, I found the problem was simple EOL conversion. All the scripts that I have been working originated in unix (LF). Edit->EOL Conversion->Windows (CR LF) on the file makes it obey my UDL folding.

    I would like to thank a someone who replies on this list, since I found the tip about checking the EOL in another post. Now I can’t find the post…

  • Find content in files and rename/delete files not containing content

    Locked
    7
    0 Votes
    7 Posts
    3k Views
    PeterJonesP

    I doubt @Samos007 will come back to confirm, but I am assuming Samos actually used File Explorer to delete the files after updating their timestamps and sorting by date.

    (And I’m happy that Samos didn’t just expect us to solve the problem, but put more effort into it; that’s encouraging that there are still random users who do put in effort into their own issues.)

    If Samos does return, Scott’s “without any special tools” challenged me: using only Windows builtin commands, two one-liner alternatives:

    for %F IN ( *.txt ) DO @( FIND /C "special text" %F > NUL && DEL %F) for %F IN ( *.txt ) DO @( FINDSTR /L "special text" %F > NUL && DEL %F)

    the builtin FIND command, using FIND /C, will print out a count of the number of matches, and also return an %ErrorLevel% of 0 to the system if it matches, or 1 if there’s no match; since I don’t care about the printing, I redirect it to NUL. I then use the windows && to cause the next command to only run if the previous %ErrorLevel% was 0 (a match). DEL will thus be run only on any files that match

    The builtin FINDSTR command, using FINDSTR /L, works similarly.

    Someday, I’ll maybe think “FINDSTR” or “FIND” instead of gnuwin32’s “grep” for matching text in Windows files… but probably not before MS has discontinued cmd.exe completely and forced me to learn PowerShell.

  • How to make new lines without deleting

    Locked
    17
    0 Votes
    17 Posts
    3k Views
    MarkomarinM

    @Scott-Sumner
    That was just the thing I was looking for, that was another thing I learned from this great community, Thanks guys.

  • Collapse level 2 not working for python language

    Locked
    2
    1 Votes
    2 Posts
    845 Views
    PeterJonesP

    I tried on v7.5.6 32bit, and it seems to not work right for me: collapse level 2 doesn’t collapse the two def’s. When I switched to a different language (Perl), with

    sub blah { do { tertiary: { 1; } }; while(1) { } }

    I was able to properly collapse and uncollapse levels 1, 2, or 3 without difficulty in Perl; but if I switch the language to python, it will only do level 1.

    Thus, it doesn’t seem to be solely the fault of v7.5.8, and it seems to be limited to Python.

    I just searched the issues page, and found https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4633 already reported … Based on what they said there (each space if indent gives a new level), I tried to collapse level 5 on your example, and the two def’s collapsed. So the bug isn’t with Notepad++, it’s with the Python-lexer that comes bundled with Scintilla that comes bundled with Notepad++. And it appears that it’s not going to be fixed, because the author disagrees that it’s a bug (it’s working as he designed it, apparently).

    So you might have to get used to calling a 4-space indent “level 5”. (sorry to be the bearer of bad news.)

  • How to find numbers and start new lines with the numbers

    9
    0 Votes
    9 Posts
    4k Views
    PeterJonesP

    (argh, typo. That should have been TIMTOWTDI… where’d my I go?)

  • 0 Votes
    4 Posts
    2k Views
    Scott SumnerS

    This question comes up rather frequently, and it is always tackled with a regular-expression solution. This is okay… but sometimes people have trouble with that, so how about this time we throw down a Pythonscript solution? [Thanks, Alan, for the hint…]

    A variant of this question is “How do I replace a list of words (and corresponding replacement values) in one document and have the replace act upon another document?”. The question in this thread is just a special case of that: Deleting is simply where a replacement value is zero length.

    So I propose that the word list should have the following form, and be present in the clipboard when the script is run, with the data file to be operated on in the active Notepad++ editor tab:

    DELIMITERsearhtextDELIMITERreplacementtext
    where replacementtext can be empty in order to do a deletion

    Here’s an example:

    Text to be copied to clipboard prior to running the script:

    :silver:golden @silently@sqwalkingly .sqwalkingly .

    I purposefully used a different delimiter character on each line to show that that is possible…hmmm, maybe this just confuses things? Oh, well…

    Text to be operated on, all by itself in a fresh editor tab:

    Six silver swans swam silently seaward

    After running the script with that editor tab active, its text should be changed to:

    Six golden swans swam seaward

    Note that in the second line of the list, silently is changed to sqwalkingly. But…in the third line, sqwalkingly followed by a space is deleted (no text follows the final delimiter, meaning change the search text to nothing, i.e., delete it).

    Hopefully the reader can follow the progression of replacements in this case.

    So…to perform the OP’s original deletion of data, one would create the word list as follows and copy it to the clipboard:

    !user3;! !user9;! !user10;! !user2;! !user30;!

    Remember, the format is: DELIMITERsearhtextDELIMITERreplacementtext where replacementtext can be empty in order to do a deletion (as we are doing here). This time I have arbitrarily used the ! character as the delimiter, and I was consistent about it in each line, as one usually would be.

    Then, running the script in the file of the original data:

    [role] rid=2000 rdesc=Members user=user100;user70;user4030;user10;user300;user33;user9;user2;user35;user290;user30;user158;user3;user893;user10;

    One obtains, with the desired users eliminated:

    [role] rid=2000 rdesc=Members user=user100;user70;user4030;user300;user33;user35;user290;user158;user893;

    Here’s the script code for ReplaceUsingListInClipboard.py:

    def RULIC__main(): if not editor.canPaste(): return cp = editor.getCurrentPos() editor.setSelection(cp, cp) # cancel any active selection(s) doc_orig_len = editor.getTextLength() editor.paste() # paste so we can get easy access to the clipboard text cp = editor.getCurrentPos() # this has moved because of the paste clipboard_lines_list = editor.getTextRange(cp - editor.getTextLength() + doc_orig_len, cp).splitlines() editor.undo() # revert the paste action, but sadly, this puts it in the undo buffer...so it can be redone editor.beginUndoAction() for line in clipboard_lines_list: try: (search_text, replace_text) = line.rstrip('\n\r')[1:].split(line[0]) except (ValueError, IndexError): continue editor.replace(search_text, replace_text) editor.endUndoAction() RULIC__main()
  • JS embedded in HTML

    Locked
    2
    0 Votes
    2 Posts
    728 Views
    Scott SumnerS

    @Gianluca-F

    i am trying to create an HTML page with one or more JS script in order integrate a survey module in a image

    We’re happy for you…but…see here.