• 0 Votes
    5 Posts
    2k Views
    Terry RT

    @R-k said in Keep 1st,4th,8th,12th.....so on lines, multiple of 4 and delete rest.:

    When i run macros multiple files, i get empty files. It delets every thing. But works file on single text file.

    I actually came up with another idea. When used with the “Find In Files” function it should work.
    You would record the following in the macro.

    Ctrl + Home keys (takes you to the first line) Line down by using down arrow, cursor should be in the first position. Add a space and a carriage return/line feed Use the “Find In Files” function with
    Find What:(?-s)^(.+\R){3}(.+\R)
    Replace With:\2
    This selects groups of 4 lines and leaves just the last one. As the first line is now followed by a blank line it’s the blank line that is deleted, not the first line. As nothing has been mentioned with regards any remaining lines (less than 4) this step is yet to be determined. It could be anther regex for when 3 lines exist, or 2 lines, or even just 1 line, returning how many required and deleting the others.

    So for your next question, likely you get empty files as using ctrl-tab cycles through the open files within Notepad++. f you don’t close (and save) that tab you will find it cycles back to that tab again I think and performs the same operation again. Although I’d suggest it would leave just 1 line in each tab, yes?

    When recording a macro you select the function, then supply the regex. I think a better option would be to use the Find in Files function. This will work through files in 1 or more folders. The files don’t need to be opened in Notepad++. So you will need to create a new macro using that function, unless you are good at editing the macro, they are fiendish to do so.

    Terry

  • "Save All" option not working

    2
    0 Votes
    2 Posts
    225 Views
    Alan KilbornA

    @soghjfik

    Can you walk us thru a series of steps you are doing (step by step, exactly; don’t generalize, don’t leave stuff out) so that we can understand better, and perhaps tell you where things are going wrong?

  • shortcuts.xml <Action> tag

    6
    0 Votes
    6 Posts
    1k Views
    prahladmifourP

    Hello,@SusiKette
    Please try this code, To shortcuts.xml <Action> tag.

    In Windows 7|8|10 C:\Users%username%\AppData\Roaming\Notepad++\shortcuts.xml

    Code:

    <NotepadPlus> <InternalCommands /> <Macros> <Macro name="Trim Trailing and save" Ctrl="no" Alt="yes" Shift="yes" Key="83"> <Action type="2" message="0" wParam="42024" lParam="0" sParam="" /> <Action type="2" message="0" wParam="41006" lParam="0" sParam="" /> </Macro> <Macro name="abc" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="a" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="b" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="c" /> </Macro> </Macros> <UserDefinedCommands>....

    I hope this code will be useful to you.
    Thank you.

  • Customizing Style Configuration

    2
    0 Votes
    2 Posts
    205 Views
    EkopalypseE

    The style configuration depends on the lexer you are using.
    So, to be able to give you some advice, may I ask you which lexer (aka language) you are using. HTML, Java, C# … ??

  • Yippee...

    1
    6 Votes
    1 Posts
    143 Views
    No one has replied
  • Issue printing files with Notepadd++

    4
    0 Votes
    4 Posts
    987 Views
    deus exD

    @Andreas-Neff

    As a workaround, try printing to a PDF-file instead. This way you have a WYSIWYG level of control, printing the generated PDF should give you the output result you are looking for.

  • Wish: Path in document switch

    3
    0 Votes
    3 Posts
    205 Views
    Lucio MenciL

    Thank you Alan
    I didn’t ever used it because it is a “popup” that has to be closed every choices. And it has some bugs: did not refresh well if there are more windows than the area contains (if there is the scrollbar, the sort doesn’t refresh well). Except this, I will learn to use windows window more and more. Assigned to a shortcut. Thank you.

  • "Compare" Plugin: Ignore lines or strings?

    1
    0 Votes
    1 Posts
    725 Views
    No one has replied
  • SRS Document

    4
    0 Votes
    4 Posts
    469 Views
    PeterJonesP

    @apantzar said in SRS Document:

    because I want to write SRS for a project that does not have one.

    That’s not what you said in your first post. But if that’s really the case, good for you.

    As I said, I don’t think such a document exists for Notepad++. Sorry

  • Selected text

    32
    0 Votes
    32 Posts
    2k Views
    Ruud SchmeitzR

    @Ruud-Schmeitz said in Selected text:

    So I’ve decided to go for this option :
    editor.setWhitespaceSize(1)
    editor.setWhitespaceFore(1,( 64, 64, 64))
    editor.setWhitespaceBack(1,(255,255,255))

    I hope that makes me happy .
    😀

    Actually it did not !

    Selecting the 8 lines of code results in :
    code - selected 01.png

    Because that’s not what I want , I deleted editor.setWhitespaceBack(1,(255,255,255)) in the startup.py file .

    The remaining PythonScript commands :
    editor.setWhitespaceSize(1)
    editor.setWhitespaceFore(1,( 64, 64, 64))

    make the selected lines of code look like :
    code - selected 02.png

    Now I’m happy .
    😄

  • Leave software far away from politics

    6
    0 Votes
    6 Posts
    2k Views
    Jinghe MaJ

    @Alan-Kilborn

    Thanks Alan. I have created a new one. Thanks again.

  • Add double quote on different words in notepad++

    6
    0 Votes
    6 Posts
    24k Views
    caryptC

    @PeterJones yes , thank you , the replace should have been “$1”\r\n at least , or i should have taken the \R into brackets in the search string , and added it into “$1”$2 . but i missed the concept that the whole search string gets replaced , if i dont instruct a rebuilding in replace . oops , my mind wasnt working .
    i am sorry @Aswin-Hadinata

  • Bit offtopic but ...

    1
    4 Votes
    1 Posts
    143 Views
    No one has replied
  • Backwards Regular Expression Search

    2
    0 Votes
    2 Posts
    480 Views
    EkopalypseE

    @sj-bt

    Just to save you from further disappointment, this forum is for discussion of how Npp can be used and whether there may be workarounds for known limitations. It is better to make a feature request as described here.

  • How to find duplicate words in two files?

    4
    0 Votes
    4 Posts
    6k Views
    Alan KilbornA

    @guy038 said in How to find duplicate words in two files?:

    Lexocographically Descending

    Yes, dammit.
    These type of typos are the death of me LATELY. :-(
    I actually realized the typo while I was napping and came back to my PC to fix it, and found you already had.

  • Replace dialog problem

    21
    0 Votes
    21 Posts
    2k Views
    PeterJonesP

    @PeterJones said in Replace dialog problem:

    “It works for me”. And I supply proof:

    Back to the “In Selection” being greyed out inappropriately: in this newer topic, a sequence was found that didn’t behave as expected. So there may actually be independent confirmation of this bug – three regulars to the forum can make this sequence give the odd behavior (greyed out inappropriately) reliably now.

    https://community.notepad-plus-plus.org/post/61035
  • Where is the user macro file?

    19
    0 Votes
    19 Posts
    4k Views
    prahladmifourP

    Hello,@Harry-Goldhagen
    In Windows, the macros are saved at %AppData%\Notepad++\shortcuts.XML

    Or

    In Windows < 7 the macros are saved at C:\Documents and Settings%username%\Application Data\Notepad++\shortcuts.xml
    In Windows 7|8|10 C:\Users%username%\AppData\Roaming\Notepad++\shortcuts.xml
    Note: You will need to close Notepad++ if you have any new macros you want to ‘export’.

    I hope this information will be useful to you.
    Thank you.

  • function list uncomplete

    7
    0 Votes
    7 Posts
    320 Views
    Roger PierreR

    @Alan-Kilborn one work-around is to define in language that it is C code.

    thanks for your help.

  • Sidebar Font Size

    2
    0 Votes
    2 Posts
    168 Views
    Alan KilbornA

    @Larry-Mars

    Probably not, but perhaps be a bit more specific about which “sidebar menu” you are talking about?

  • Replace partial text

    3
    0 Votes
    3 Posts
    291 Views
    Panagiotis AlexoulaP

    @Terry-R Yes!! Thats is thanks mate