• Opening and interacting with .txt files

    2
    0 Votes
    2 Posts
    912 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
    427 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
    474 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
    479 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
    720 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
    341 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
    410 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
    557 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
    387 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
    182 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
    376 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.

  • Extract 10+ words after :

    2
    0 Votes
    2 Posts
    184 Views
    EkopalypseE

    @phantom-dviper

    If the layout of your data is as you posted, a regex like: (?<=\:).{10,}
    find passwords with 10 or more characters.
    Use the mark tab from the find dialog and bookmark the lines when searching.
    Then select the desired function from the Search->Bookmark menu.

  • Replacing specific text from document A to B

    5
    0 Votes
    5 Posts
    480 Views
    PeterJonesP

    @václav-trunec said in Replacing specific text from document A to B:

    If I do this, the document will not be usable for our developers, since it also moves the { and } characters, determining the end of a translation key. Is there a way to skip this?

    If you follow Guy’s full instructions, you will see that he added a “key” (the extra text) which will allow his two different sorts to undo each other: he sorts on that “key”, and then in the end, it re-sorts back to the original order. As Guy said, “The order of lines, in Document E, should be identical to the Document B order” after his last step.

    -----

    Alternatively, I recently published a script in a similar discussion, which will allow you set up pairs of English/OtherLanguage translation strings (or, in your case, OtherLanguage-to-English). If you follow the instructions in that post, but use the original/Czech as the left side of the translation dictionary and the translated/English as the right side, it should work.

    So, instead of using the example from that discussion:

    translation = { r'"JJIS number:"': r'"د JJIS شمیره:"', r'"Choose one"': r'"یو يې غوره کړئ"', r'"Social Security number:"': r'"د ټولنیز مصؤنیت لمبر:"', r'"State ID \(SID\):"': r'"د ایالت ID \(SID\):"' }

    … you would use something like …

    translation = { r'Najděte upozornění patřící konkrétnímu alertu podle jeho názvu': r'Find the alert belonging to a specific alert by its name.', r'Hledat podle nazvu alertu': r'Search by alert name' }

    (remembering to end every pair except the last one with a comma

  • 0 Votes
    6 Posts
    648 Views
    Dimitris TheocharidisD

    @alan-kilborn I have just tried your work. Fantastic!!! Thank you very much for your time!!! Hope life is generous with you, as much as you are with strangers! Thank you again!

  • UDL Code folding on keyword

    16
    1 Votes
    16 Posts
    1k Views
    Lycan ThropeL

    @ekopalypse

    @ekopalypse said in UDL Code folding on keyword:

    (I’m not sure if it means the same as “half the rent,” as we say in Germany).

    We don’t use that phrase, but I understand the analogy as being similar. :)

    As you point out, it doesn’t work as one expects, and is hard to diagnose if it doesn’t at least follow the rules as laid out in documentation, which is why it was so hard to fix, and how you figured it out makes you more of a magician. :)

    Either way, thanks again, and now I need to make an updated package and let your users know we have gotten it fixed. It was the one glaring shortcoming to making it similar to the dBASE IDE editor, which is based on SCITE also.

  • Program settings dont have any effect on coding format

    2
    0 Votes
    2 Posts
    173 Views
    PeterJonesP

    @nolan-m ,

    The Notepad++ settings only affects Notepad++, not all of Windows. Explorer’s New File creation is completely separate from Notepad++.

    If you use Notepad++ File > New or equivalent, it will use the setting you mentioned.

  • Duplicate all bookmarked lines

    3
    0 Votes
    3 Posts
    591 Views
    Alan KilbornA

    I should have added to my previous post:

    Forget the bookmarking idea entirely; it isn’t useful to the task at hand.

  • 0 Votes
    2 Posts
    289 Views
    Alan KilbornA

    @alimirzaei5778 said in How to calculate average for XML attributes which their value equal to zero using the before and after values:

    Any help would be appreciated.

    Learn a programming language and how to program.

    Seriously, that’s the way.

  • Trouble searching and finding "same" but unique strings...

    4
    0 Votes
    4 Posts
    377 Views
    Terry RT

    @jason-sederquist said in Trouble searching and finding "same" but unique strings...:

    I cannot place images in the compose box, nor reply to YOUR post…

    When replying to a post, you normally either select something in the post you replying to (you’ll see some reference in my one to some text in yours) or just click on the “reply” text (in red) bottom left of the post you are replying to.

    To insert an image, I would put it in my clipboard (so on Windows Ctrl-C), then in the compose window Ctrl-V and it inserts a temporary link. It will then quickly upload that image which will show when the post is “submitted”.

    Good thing you were able to sort yourself out anyways. We are here if things get more complicated for you, so don’t hesitate. But if posting examples please do follow the guidelines. We find most of the issues solving people’s problems is getting the initial examples right.

    Terry