• Fusing all Lines not starting with a Specific string with the line above.

    3
    0 Votes
    3 Posts
    210 Views
    guy038G

    Hello, @nili-30000, @dinkumoil and All,

    Here is my solution which :

    Rewrite the line-break if it is followed with a line having not more than 10 chars followed with a ) character

    Replace the line-break with a space character, in all the other cases

    Let’s begin :

    Do a normal selection of a range of lines that you want to modify, without including the last line-break

    Open the Replace dialog ( Ctrl + H )

    Untick all options

    Tick the In selection option ( IMPORTANT )

    Delete any text in the Find what: zone

    Replace it with the expression (?x-s) (\R) (?= .{1,10} \) ) | \R

    Write the expression ?1$1:\x20 in the Replace with: zone

    Choose the Regular expression search mode

    Click once only on the Replace All button ( Do not use the Replace button ! )

    From your INPUT text, where I added some pure blank lines :

    N09-M06) Welche Maßnahme n hat der Aufsichtführende vor Arbeitsaufnahme unter Anseilschutz un ter anderem zu ergreifen? a) Die Anzahl der vor handenen Sicherheitsgeschirre sind zu erfassen b) Die Benutzer sind name ntlich zu erfassen c) Die Benutzer sind zu unterwei sen und die Anschlagpunkte sind vo rzugeben d) Es sind keine besonderen Maßnahmen zu ergreifen, da die Arbeit u nproblematisch ist für Führungskräfte der operativen Ebene

    You should get your expected OUTPUT text :

    N09-M06) Welche Maßnahme n hat der Aufsichtführende vor Arbeitsaufnahme unter Anseilschutz un ter anderem zu ergreifen? a) Die Anzahl der vor handenen Sicherheitsgeschirre sind zu erfassen b) Die Benutzer sind name ntlich zu erfassen c) Die Benutzer sind zu unterwei sen und die Anschlagpunkte sind vo rzugeben d) Es sind keine besonderen Maßnahmen zu ergreifen, da die Arbeit u nproblematisch ist für Führungskräfte der operativen Ebene

    Best regards

    guy038

  • Notepad++ change characters while open a file?

    5
    0 Votes
    5 Posts
    2k Views
    PeterJonesP

    @Arí-Ricardo-Ody said in Notepad++ change characters while open a file?:

    There is a cobol program on an IBM mainframe that requires the data it handles to have a hex x’0D’ after the last byte of each line.
    I’m just trying to prepare a text file in Notepad++ that will be transmitted to the mainframe.

    As @Alan-Kilborn said, that means your mainframe is expecting Macintosh-style line endings.

    In case you don’t understand line endings (most Windows users do not – though I would think anyone who was working on a Windows machine for an IBM mainframe would), there are three common sets of bytes that refer to the end of a line for text/source-code files:

    Unix/Linux: uses a line feed (ASCII 10, aka x’0A’ in your hex-based nomenclature, aka LF) Old Macintosh (and apparently IBM mainframe cobol compilers): uses a carriage return (ASCII 13, aka x’0D’, aka CR) Windows: uses a carriage return followed by a linefeed (ASCII 13 then ASCII 10, aka x’0D’ x’0A’, aka CRLF)

    Notepad++ defaults to using Windows line endings… unless you are opening a file that already has a Linux or Mac style line ending consistently used throughout, in which case it will auto-detect the right ending.

    So this means you are creating a new file from scratch, and thus it defaulted to Windows CRLF endings. Use the method Alan showed (or right clicking on the “Windows (CRLF)” on the lower-right of the Notepad++ status bar) to change the line endings.
    f268559d-77b7-4293-80ee-55a4016969bc-image.png

    Also, if you are using FTP to get the cobol source code from the Windows PC to your mainframe, you will have to pay attention to ASCII vs BINARY transfer mode: BINARY will transmit the bytes as-is; ASCII will convert CRLF on your PC to the native line-ending format of the destination machine, and vice versa, as long as the FTP server on the other end is configured correctly. Make sure you understand how your FTP client (or whatever file-transfer protocol you use: rcp, sftp, ftps, going across a SAMBA server, or whatever) deals with line endings, because no matter how careful you are in your text editor, if your transfer protocol changes things, you will get more confused.

    I didn’t understand your censure when you say that I’m doing it wrong, without knowing the reason why I’m doing it.

    His censure was because you were going about it wrong. (And more over, his actual phrasing was “don’t do what you are attempting… unless you can provide sound reason for doing so”. There was a sound reason for wanting x’0D’ as the line ending (because your IBM mainframe Cobol compiler wants that line ending)… but you were just going about the process in the wrong way when trying to get a necessary line ending (or at least, what you described yourself as doing was wrong; I cannot know whether you were actually doing it right and just didn’t describe it correctly).

    To clarify why the way you described is the wrong way: just arbitrarily adding the x’0D` byte to the end of lines that already have x’0D’ x’0A’ as the line ending won’t do what you want… because then the bytes will be either x’0D’ x’0D’ x’0A’ or x’0D’ x’0A’ x’0D’ (depending on where on the “end” of the line you added the x’0D’), which will not be what your compiler would want. The way you described things, you were fighting against the way that both KEDIT and Notepad++ deal with line endings, and hoping it would come out right, rather than understanding line endings and the tools you were using to get them to natively use the right line endings.

    So your end goal was reasonable. And Alan and I have now explained how to make Notepad++ give you your end-goal in the correct manner.

  • mark a line using a single button with macro or any feature.

    3
    0 Votes
    3 Posts
    387 Views
    PeterJonesP

    @Shekhar said in mark a line using a single button with macro or any feature.:

    highlight a line by pressing a single key or by highlight a line by using a macro function.

    By “highlight”, I assume you mean “select”, like what is accomplished by triple-clicking a line. Unfortunately, triple-click is not macro-recordable, and there is no single “scintilla command” that you can assign a shortcut to (that I am aware of).

    However, using Scintilla command IDs, you can craft your own macro:

    Edit %AppData%\Notepad++\shortcuts.xml * * Insert the following into the <Macros> section <Macro name="HomeShiftEnd" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2312" wParam="0" lParam="0" sParam="" /> <Action type="0" message="2315" wParam="0" lParam="0" sParam="" /> </Macro> Save. Restart Notepad++

    Now you have a macro called “HomeShiftEnd” which will do what i think you want. You can assign a keyboard shortcut to that, just like any macro.

  • Updating to V8.4.7, lost all my previous tabs

    3
    0 Votes
    3 Posts
    229 Views
    Bob KinzettB

    @PeterJones Thanks Peter… gives me some direction to work with

  • How to set "Find" Background colour?

    32
    0 Votes
    32 Posts
    9k Views
    Lycan ThropeL

    @Angga-Setia-Budi ,

    Mind you, your question doesn’t really apply to this thread’s discussion, however to move you along, here’s the steps needed. Go to the menu bar Preferences->Style Configurator->Language: Global Styles and then Style: Default Style. You’ll then see the two color selectable boxes to the right in the Colour Style Section of the Dialog box. You can set the colors there for whatever you want for the non-focusing line colors, and then go down to Style: Current line background and again, look to the right to see the color selection boxes to choose the colors from there. Now mind you, if it’s a predefined language you’re using, that will change the colors for all the language.
    See Below:
    StyleConfiguratorSelection.PNG

  • "Remove Unnecessary Blank and EOL" ?

    10
    0 Votes
    10 Posts
    3k Views
    Alan KilbornA

    @donho said in “Remove Unnecessary Blank and EOL” ?:

    I agree it’s named very badly. Do we have a better naming? Any suggestion?

    Not a great one. But see HERE.

  • N++ x,y pixel locations for cursor!

    3
    0 Votes
    3 Posts
    317 Views
    Alan KilbornA

    I don’t know much about AHK, but there’s some info that might interest you HERE.

  • Text selection color is gone since a few updates

    3
    0 Votes
    3 Posts
    316 Views
    cubedjC

    Correction - the plugin works fine only the settings file got probably corrupted by the NPP update… delete just the file “ExtSettings.ini” in “%appdata%\Notepad++\plugins\Config” … that should be enough to fix it ;)

  • "Display line number" feature disappeared

    4
    0 Votes
    4 Posts
    308 Views
    Alan KilbornA

    07af32b5-a997-4516-9178-fd5a992b5c33-image.png

  • Copy all Phone numbers

    7
    0 Votes
    7 Posts
    1k Views
    Mobil MeisterM

    @Alan-Kilborn
    thank you,
    that work very well

    problem is if I read most of the time I don’t know what they mean, because I’m asking the wrong questions

  • Regex to replace a specific word

    4
    0 Votes
    4 Posts
    831 Views
    Alan KilbornA

    @Calimero said in Regex to replace a specific word:

    Using this one and some others I was able to do what I wanted … almost
    I wasn’t good enough to deal with all the cases only with regex and I had to modify some cases manually

    Hopefully it wasn’t a defect/limitation of the technique in the link I provided.

  • autoCompletion Issue

    28
    0 Votes
    28 Posts
    3k Views
    PeterJonesP

    @Grzegorz-Śliwka said in autoCompletion Issue:

    Your example doesn’t work for me.

    Whereas it did work for me. Without giving us more to go on, I cannot even begin to guess what you’ve actually done, and whether you’ve really set things up right according the instructions above. Sorry.

  • N++ asking to save files on shutdown - 80 times

    3
    0 Votes
    3 Posts
    320 Views
    timwesselsT

    @PeterJones Thank you! 👍

  • replace/delete numbers from different lines

    2
    0 Votes
    2 Posts
    263 Views
    gerdb42G

    Right click on text -> “Select all” -> Hit “Del” on keyboard -> voilá.

    Well, I think this is not quite what you want to achieve, so please elaborate a little more detailed what your goal is.

    Please also have a look at this FAQ

  • Code alignment doesn't work properly

    3
    0 Votes
    3 Posts
    827 Views
    E

    @Michael-Vincent It is so shocking I lost my words. Thanks a lot for your help it’s all I needed.

  • notepad++ doesn't open up automatically

    5
    0 Votes
    5 Posts
    2k Views
    LittleZockerBrownieL

    @PeterJones ,

    Again, thanks a lot for your help. Now everything runs as it should.

  • пропали файлы/missing files

    2
    0 Votes
    2 Posts
    514 Views
    Alan KilbornA

    @Андрей-Плотников

    people help urgently please, rebooted the laptop, opened notepad, but it is empty, there are no files, this command does not help C:\Users\UserName\AppData\Roaming\Notepad++\backup, it is not just on the computer, but how to restore all the files? it is very necessary, there is a lot of work and many projects, everything is gone than 2 years ago, it is really very necessary, please help me so that I lose the meaning of life, because everything was there

    please help me so that I don’t lose the meaning of life, because everything was there

    Going forward, there are some “data safety” hints offered up in the FAQ HERE.

  • 0 Votes
    3 Posts
    213 Views
    Андрей ПлотниковА

    привет друг, такая же проблема, ты решил эту проблему, смог востановить все файлы?

  • 0 Votes
    3 Posts
    1k Views
    SUMI ACES

    @Terry-R thank you Terry

  • NPP settings

    5
    0 Votes
    5 Posts
    392 Views
    Terry RT

    @kracovwolf said in NPP settings:

    I am trying real hard to remember what plugin i used that ran multiple macros at once. i really need it. it was a toolbar button

    Unfortunately unless someone knows from that brief description what plugin it is, you might have to do the hard yards and manually check for differences between the 2 installations.

    Firstly you will need to have the same type of installation 32bit or 64bit. That’s because some plugins are ONLY made in the 1 version.

    Then by using the “Debug Info” you can see quickly which plugins the old installation has. From your post I suspect that may not be possible, otherwise you would likely have already figured it out. Have you by chance ever had to provide “debug info” on this forum, that may be some help to you.

    To complicate matters, if you happen to have an old Notepad++ version in the original, and are downloading a much later version for the new installation, you will come across the “incompatible” issue. The most recent versions of Notepad++ had a major change made in coding (API calls I think), and this caused a lot of the plugins to be incompatible.

    Then there is the issue that some plugins were never listed in the “Plugin list” as viewed from the link in Notepad++ PlugIns Admin window (bottom right for the repository). Some of those developers never got them added so to download you will need to find the alternate site for that.

    I myself have no need to install plugins, so I don’t know which one your description points to.

    Good luck
    Terry