• How to extract just "text" with notepad

    Locked
    3
    1 Votes
    3 Posts
    2k Views
    Unlyn321U

    Hi Scott,

    Thanks for answering this quickly!

    My example was a bit flawed I realise, but the whole document is several thousand lines long and with very distinct “beginning text”.

    It would definitely help, but that still require a lot, a whole lot of manipulation.
    I’ll try it though, maybe after a bit of cleaning my spelling software will be more useful.

    Thanks!

  • How to batch out lines of code with same code but different variables?

    6
    0 Votes
    6 Posts
    2k Views
    guy038G

    Hi, @shadowfire-omega and All,

    Hope you don’t mind my late reply ! So, given the 8 lines "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+", which end, each, with a word, after the = separator sign

    "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Appraise "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Bluff "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Concentration "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Test "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Shadowfire "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Omega "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=OK "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=The End

    and the regex S/R :

    SEARCH (?-is)Appraise(?=.+=(.+))|=.+

    REPLACE ?1\1

    First, the (?-is) forces the regex search to be sensitive ( non-insensitive !) to the case and the dot . regex character to represents any single standard character and not an End of Line character

    Then it matches any of the two alternatives, giving priority to the first one

    The regex (?-is)Appraise(?=.+=(.+))

    The regex =.+

    If the first alternative is chosen, it, then, matches the Appraise string but only if the look-ahead feature is verified. That is to say if there is, further on, in the same line, a = sign, followed by some standard characters, which ends the current line. As this condition is, by construction, always true, the part after the = sign is, thus, stored as group 1

    As soon as the = location is reached, by the regex engine, no more = sign can be found, afterwards. So, the first alternative cannot be matched, anymore, in current line !

    But, now, the second alternative =.+ matches all the end of line, beginning with the = sign

    In replacement, ?1\1 is a conditional structure, which means :

    If group 1 exists, we replace the string Appraise with the contents of group 1

    If group 1 does not exist, we do not rewrite anything. So, the range of characters beginning with the = sign till the end of current line, is deleted

    Et voilà !

    Cheers

    guy038

  • 0 Votes
    10 Posts
    3k Views
    guy038G

    Hi, @terry-r and All,

    A very simplified version of my regex (?-s)^(.+ by ).+\[only as by (.+)\], could be :

    ^.+ by .+[only as by .+] ( BEWARE : This syntax is not functional, it’s just for explanations !)

    As the syntax .+* stands for the longest range of standard characters which can match the remaining part of the regex :

    Then, this regex searches, from beginning of line, for :

    Any non-null range of standard characters, followed with the string by surrounded by two space characters

    Then, followed with a second non-null range of standard characters, followed with the string [only as by, followed with a space

    And, finally, with a third non-null range of standard characters, followed with the ] symbol, ending the line

    Don’t be afraid to ask the community if you feel some difficulties, when elaborating some advanced regexes !

    On the other hand, you’ll get some regex documentation here

  • Quote/apostrophe macros insert garbage text

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    guy038G

    Hi @FriendOfFred, and All,

    I, personally, add your macro, which works correctly, on my configuration ! But I admit that I didn’t do intensive tests to determine when something is going wrong !

    I’ve replied to a similar question, in the post, below :

    https://notepad-plus-plus.org/community/topic/15909/replace-text-between-2-characters/2

    So, here is a regex S/R, which will normalize the normal quotes to their enhanced version !

    SEARCH (?-s)["“](.+?)["”]|['‘](.+?)['’]

    REPLACE (?1“\1”:‘\2’)

    Select the Regular expression search mode

    Tick the Wrap around option

    Click on the Replace All button

    Et voilà !

    So, given this initial text, below :

    "Test" "Test” “Test" “Test” 'Test' 'Test’ ‘Test' ‘Test’

    You should get the following text :

    “Test” “Test” “Test” “Test” ‘Test’ ‘Test’ ‘Test’ ‘Test’

    So, at any time, when you perform this S/R, you’re sure that, after replacement, you get the two syntaxes “Test” and ‘Test’, only !

    You could, even, record this S/R as a macro, if you prefer to !

    Cheers,

    guy038

  • Opening Unix style file paths

    2
    1 Votes
    2 Posts
    1k Views
    Scott SumnerS

    @mkupper

    Not sure about all of the info you provided but…

    What is your setting for this redboxed option…there may be a clue in the blue underlining…? :

    Imgur

  • 1 Votes
    1 Posts
    1k Views
    No one has replied
  • Resets to top of document when I change tabs within N++

    9
    0 Votes
    9 Posts
    2k Views
    Brigham NarinsB

    I’ve noticed the same problem as Loren describes, except for me the position is not set all the way back to the top of the file, it’s set only a few lines up from the cursor position. The cursor will be off screen (below). The left/right key workaround works, but it’s not really what we want.

    I should note that this is a recent issue, I haven’t noticed it in previous versions. Let’s hope it’s easy enough to fix. Thanks!

  • 0 Votes
    1 Posts
    613 Views
    No one has replied
  • The number of digits after the point in the code that is in Notoped++

    Locked
    8
    0 Votes
    8 Posts
    3k Views
    rita252525R

    Thank you. It works.

  • Remove one character before a character

    Locked
    4
    0 Votes
    4 Posts
    2k Views
    mkupperM

    If you had Test | Word and replaced the | with a space then you would have three spaces, not two.

    If your list uses | as a separator and that sometimes there are one or more spaces before and/or after the | then use regular expression mode.
    Search for: \x20*\|\x20*
    Replace with: \x20

    The first \x20* looks for zero or more leading spaces. I used \x20 rather than a space self as it’s easier to see on the screen. \| looks for the |. In regular expression mode a | is special and so use \| to search for a | itself. The second \x20* looks for zero or more trailing spaces.

    If your data has either one or zero spaces before and after the | and never had two or more spaces before/after the | then you can use
    Search for: \x20?\|\x20?
    Replace with: \x20

  • CTRL-L overwrites Clipboard

    2
    1 Votes
    2 Posts
    1k Views
    guy038G

    Hello, andreas-petersen,

    No, andreas, it’s not a bug ! Indeed, there are some specific Scintilla commands which involve lines :

    SCISELECTIONDUPLICATE : Copy current selection or current line, under the cursor location ( Ctrl + D )

    SCILINEDELETE : Delete current line, without copying its contents in the clipboard ( Ctrl + Shift + L )

    SCILINECUT : Cut current line and copy its contents in the clipboard ( Crtl + L )

    SCILINECOPY : Copy current line in the clipboard ( Ctrl + Shift + X )

    SCILINETRANSPOSE : Swap the current line with the line just above ( Ctrl + T )

    And also :

    Notepad Command : Move Up Current Line ( Ctrl + Shift + Up )

    Notepad Command : Move Down Current Line ( Ctrl + Shift + Down )

    Of course, with the Shortcut Mapper, you can customize your own shortcuts for these commands ! Just choose the Scintilla tab ;-))

    Best Regards,

    guy038

  • Strange behavior in Find dialog

    Locked
    4
    0 Votes
    4 Posts
    1k Views
    YaronY

    I’m glad it’s working as expected now.
    You may have accidentally pressed a keyboard-shortcut which changed the text direction.

  • 0 Votes
    3 Posts
    2k Views
    Jason CarswellJ

    Also, using Fountain markup would be good to work on with a “code/compose” and “preview” panels, easily done side by side, like this forum, or like Wikimedia editing.

  • Launching index.php in a browser

    Locked
    1
    0 Votes
    1 Posts
    653 Views
    No one has replied
  • 0 Votes
    1 Posts
    631 Views
    No one has replied
  • How execute macro in all files open?

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Scott SumnerS

    @Jose-Victor-Mirandola-da-Silva

    Hmmm, not sure you can, without some help…

    For example, you could script something with the Pythonscript plugin that would loop over all open XML files and execute this:

    Notepad.runMenuCommand('Macro', 'your macro name here')

    Probably more effort than you wanted to go to…

    Maybe there’s a way with the NppExec plugin? Experts on that plugin please chime in if so…

  • How do I leave the colored letters?

    Locked
    2
    0 Votes
    2 Posts
    704 Views
    Thiago VitorT

    I found the mistake!

  • Easy task but driving me crazy

    Locked
    7
    0 Votes
    7 Posts
    2k Views
    Scott SumnerS

    And BTW I believe it is pronounced “Tim-Toady”

    :-)
  • Extrem long loading time of big text-files?

    10
    0 Votes
    10 Posts
    6k Views
    Tim NanosT

    Just as Harald-Napp said, I have some troubles opening files with very long strings.
    I have a file ~60MB with a single string and it takes several minutes to open it, while Lister or even Windows Notepad just takes several seconds.
    It would be really great if you guys manage to improve the performance of opening such files.
    Thanks!

  • Displaying ASCII ?

    Locked
    4
    0 Votes
    4 Posts
    1k Views
    Scott SumnerS

    @Scott-Sumner said:

    In what ASCII scheme is a “space” equal to “55”?

    Maybe the “55” was supposed to be a “SS”…short for “Single-Space”?

    :-D