• How do I replace a text after an = ?

    2
    0 Votes
    2 Posts
    198 Views
    Alan KilbornA

    @ezz-zee said in How do I replace a text after an = ?:

    Find: local Cooldown = \d+
    Repl: local Cooldown = 0
    Search mode: Regular expression

  • Word-wrap crashes TextFx in npp 8.4 and newer

    2
    0 Votes
    2 Posts
    342 Views
    Alan KilbornA

    @mkupper said in Word-wrap crashes TextFx in npp 8.4 and newer:

    discovered that 8.4, 8.4.1, and 8.4.2 are all broken

    Nope, it is not Notepad++ that is broken. It’s the plugin.

  • Regular replace does not work with multiple single quotes

    2
    0 Votes
    2 Posts
    266 Views
    PeterJonesP

    @mscislawin said in Regular replace does not work with multiple single quotes:

    when i copy that and paste it to n++ and do the normal find plus normal replace and want to replace all ‘’ with ’ it only replaces first occurence of the ‘’

    Did you click Replace or did you click Replace All after setting up Find what: '' and Replace With: ' ?

    Because
    76b51f95-e538-48cd-9e09-46b913b4812e-image.png
    =>
    f7fde8af-b620-4656-b355-c851309e7048-image.png

    'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');' 'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');' 'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');' 'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');' 'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');'

    =>

    'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');' 'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');' 'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');' 'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');' 'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');'

    It does exactly what I’d expect

  • Add line break in paste after multi-editing

    12
    0 Votes
    12 Posts
    3k Views
    PeterJonesP

    @alan-kilborn said in Add line break in paste after multi-editing:

    wait for someone else to try it, and weigh in on how it went for them

    I installed the script, selected old text and verified it was in the clipboard by pasting. Then I selected two or three disjoint sections in multi-select mode, ran the script, and then pasted, and it pasted each section of the new multi-section data with a newline between, so worked exactly as I believe it was described.

    @Spiros-Doikas , you should look at Plugins > Python Script > Show Console after running the script, and see if it is giving you an error message.

  • How to move from the Search/replace to the edit window.

    2
    0 Votes
    2 Posts
    211 Views
    Alan KilbornA

    @george-worley

    AFAIK the only way is to press Esc which closes the “Find” window.

  • How to schedule a python scripts in plugin manager?

    2
    0 Votes
    2 Posts
    261 Views
    EkopalypseE

    @hulu2007

    What does “repeated” mean in this case?
    Time-based, event-based, or other triggers?
    Because if you are the only one editing these files it
    might be better to run the script once and then use
    another script that ensures that files from that location
    use Ansi encoding.

  • #region support for languages

    4
    0 Votes
    4 Posts
    2k Views
    Noreh ADN

    That’s a bummer. And modifying the source code for something like this seems like a hassle for me. So I’ll probably ignore it :)

    In VS Code (might need extensions though), for example, regions that are in comments (// #region and // #endregion) are supported (in languages like JS, PHP). It’d be nice to have something similar in Notepad++ too.

    I usually use VS Code when I’m working on a project, but for quick modifications, I prefer Notepad++. So I definitely want to see Notepad++ improve.

  • Problems with bidirectional text & find/replace

    7
    0 Votes
    7 Posts
    2k Views
    House EmptierH

    @alan-kilborn That is correct. I can successfully use Notepad++ to do my find/replace task… IFF I watch every term get replaced. If I use Replace All, with a long “Replace with…” string that has complex/SE Asian script in it, then there seems to be some kind of greediness problem that leads to non-matching text being deleted.

    @peterjones Yes, thanks for posting that Python script, it was very useful, and I was able to use it to skip a whole bunch of manual copy/pasting. Anyhow, w/r/t the Unicode declaration in the header: I see it now, the problem was between my chair & my keyboard. I think I deliberately excluded your discussion that was surrounded by triple quotes, which I’m guessing is the Python code-comment convention? … Yep, it is! So when I copied your code, I purposefully skipped all of your discussion-in-comments, so I missed the header entirely, due to my Python ignorance.

  • Opening and interacting with .txt files

    2
    0 Votes
    2 Posts
    1k Views
    PeterJonesP

    @binary_kitten ,

    Are you saying, “I want to use Notepad++ to type the source code for my application”? If so, then do that. I am not sure what the question is in that case.

    Are you saying “I want to use my application that I am creating to remote control Notepad++ to automate using Notepad++'s search”? Then do that: Notepad++ accepts standard Windows messages, with a documented API (noting that the documentation assumes that you are writing a plugin that’s running inside Notepad++, but the API works equally well from the outside, as I have shown with my Perl module Win32::Mechanize::NotepadPlusPlus, which allows a Perl script to send messages to Notepad++ to remote control it.

    Are you saying “Can I use Notepad++ as a command line ‘filter’ program, where I go notepad++.exe --someFindOption="searchText" FILENAME.txt and it will output just the matching lines”? If that’s what you are asking, no, from two perspectives: 1) there isn’t yet a run-the-FIND-from-command-line option (perhaps “there isn’t that option yet”: I think it’s been requested, though I don’t remember whether that request is in process or whether it was rejected), and 2) notepad++ doesn’t have a way to dump the contents of a file to the STDOUT. Notepad++ is an interactive Windows GUI program, and is intended to be used as such.

  • multi search and replace in multi files with python

    3
    0 Votes
    3 Posts
    526 Views
    Pouemes44P

    thanks will try to find

  • Notepad++ v8.4.2 (64-bit) causing "his file cannot be saved..." errors

    4
    0 Votes
    4 Posts
    695 Views
    Alan KilbornA

    @r-d-vaughan

    If you don’t get any helpful replies in this thread after a period of time…you may want to “elevate” this by posting in the release thread for 8.4.2.

  • Regex - replace subexpression in a repeated subexpression

    5
    0 Votes
    5 Posts
    557 Views
    guy038G

    Hi, @mohammad-hussain, @neil-schipper and All,

    Your active shortcuts.xml file should be located, either :

    In the %appData%\Notepad++ folder, for a standard installation with the installer

    In the Notepad++.exe folder, for a local installation

    Then :

    Start Microsoft notepad.exe

    Open the right Shortcuts.xml file

    Insert, at the end of the <macros>...</macros> mode, the following macros Macro_A, Macro_B and Macro_C :

    <Macro name="Macro_A" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-i)(?&lt;=\\)[^\\]+\.html?|(^P:\\|^\h*\R)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam='(?1:&lt;file name=&quot;$0&quot; mark=&quot;marked&quot;/&gt;)' /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro> <Macro name="Macro_B" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-is)^(.+?)\\.+\R(?:(?:(?!&lt;/).)+\R)*\1\\.+\R|^(.+?)\\&lt;file name.+\R" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam='&lt;folder name=&quot;\1\2&quot;&gt;\r\n$0&lt;/folder&gt;\r\n' /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)^(?!&lt;).+?\\(.+)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="\1" /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro> <Macro name="Macro_C" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="^(?!&lt;).+" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1614" sParam="" /> </Macro>

    Save the modifications

    Now, stop and restart Notepad++

    Open your INPUT file

    First, run, once only, the Macro_A macro

    Then, run several times the Macro_B macro

    From time to time, run the Macro_C macro in order to verify if the process is terminated. Note that the Find dialog must be opened to get the results !

    Remark :

    You may assign a shortcut to each of these macros :

    Use the Macro > Modify Shortcut/Delete Macro option

    Double-click on each macro and enter your preferred shortcut

    Best Regards,

    guy038

  • Sorting text

    5
    0 Votes
    5 Posts
    1k Views
    Alan KilbornA

    @lakshman-ragde

    You said:

    the lyrics in my file are separated by 4 spaces between each lyrirc

    You also said:

    The next lyric starts after 4 blank lines, the next after another 4 lines and so on

    These are different things.
    I think I know what you mean, but again, why should we guess on this point.
    You would have cleared up the confusion on this if you would have followed the Template for Search/Replace Questions that you were linked to.

  • Notepad + ansible + win_chocolatey = head scratcher

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP

    @benoit-valenti said in Notepad + ansible + win_chocolatey = head scratcher:

    installing Notepad++ in portable mode (using /D= )

    BTW: to clarify, /D on the installer does not make it use portable mode, it just installs to a different location. To be “portable” mode (and use the local folder rather than %AppData%\Notepad++), you must create the zero-byte doLocalConf.xml in the notepad++.exe directory.

  • Cloud Sync and Themes

    2
    0 Votes
    2 Posts
    418 Views
    PeterJonesP

    @zaf9670 ,

    It sounds to me like it’s trying to read the theme off of your cloud, but that it’s having intermittent trouble reading the file from the cloud directory. If you do not have reliable connection to your cloud directory, using cloud settings is not a good idea for Notepad++.

    I might suggest turning off the “cloud” setting in Notepad++, and instead manually copy the “golden” files from your cloud location into your %AppData%\Notepad++\ hierarchy, so that Notepad++ can read it from %AppData% whether or not you currently have access to your cloud location.

  • Implied folding close

    4
    0 Votes
    4 Posts
    788 Views
    PeterJonesP

    @jeff-bowles ,

    FYI: We in the Forum cannot change the codebase, and the Forum is not the official feature request location.

    That said, even if you were to create a feature request in the official location (as described in the FAQ), I doubt it would be implemented. The UDL has not had any significant/meaningful changes in years. (The lack of UDL development is my biggest complaint about Notepad++, because there have been critical known issues, like not handling unicode characters, not allowing pattern matches rather than literals in the keywords and folding, and the other limitations in folding: I’m sure these limitations are chasing away many users, who would actually use Notepad++ if those were fixed/implemented. My long-term hope is that someone will take it upon themselves to write “UDL 3.0” as a plugin-lexer, and re-implement it from the ground up with the modern features, but that’s a huge ask, and something that I don’t yet have the skills or bandwidth to do [and aren’t likely to in the next few years])

  • Python script as a notepad++ extension.

    5
    0 Votes
    5 Posts
    704 Views
    PeterJonesP

    @jdecrypted ,

    See the FAQ: How do I use Notepad++ to … Convert My Text.

    Please note: that FAQ was written to explain both compiling text (which does not appear to be what you want) and converting text in-place (which does appear to be what you want). So don’t read the title including the word “Compile” and complain that it’s not answering your full question. It does, if you read the whole FAQ entry.

  • Selected text goes funky when N++ loses focus

    6
    0 Votes
    6 Posts
    495 Views
    Alan KilbornA

    It appears a fix is made (but not yet released of course).

  • Non-responsive when starting up

    2
    0 Votes
    2 Posts
    230 Views
    Real RavenR

    I think I found the culprit - I had network paths in my project panel pointing to a NAS drive that is currently unavailable (or maybe damaged). Whenever I activate my project panel I can work but when notepad++ restarts it “santity checks” all documents in the project list and I think it just takes ages because the timeout for each item is just too long and adds up to the app hanging.

    While I find sanity checking of the paths useful, it would be really good if this task could be done in a separate thread that doesn’t block the UI.

  • Selecting date range

    2
    0 Votes
    2 Posts
    471 Views
    Neil SchipperN

    @ahmad-faisal-ahmad-zaki

    The answer is yes, there are ways to retain or copy only records in a date range (although I suppose there are date representations that would make it cumbersome).

    If there’s exactly one date format used by SQL someone else may be able to reply with details. Otherwise, see the FAQ and provide representative sample data.

    Also, I suppose you’re aware that data extracted from a db can undergo date filtering at extraction time.