Select Line EXCEPT Hard Return/NewLine

Select Line EXCEPT Hard Return/NewLine

2
NewbieNewbie
2

    Aug 27, 2008#1

    Anyone knows how to select a line of text excluding the hard return/newline (and not using drag selecting)? Normally, one could click the line-numbering at the left or triple-click, but such line selection would include the hard return/newline. I tried using combinations of modifier keys (Shift, Ctrl, Alt, etc) w/ no luck.

    Another issue is the complete line selection w/ word-wrap enabled? Normally, w/ word-wrap enabled, automatic line selection would only be based on the line formed by the limitation of the GUI view, and not on the actual line terminated by a hard return/newline.

    The first question is my primary concern.

    Thanks

    6,675585
    Grand MasterGrand Master
    6,675585

      Aug 27, 2008#2

      How do you want to select the whole content of a line - with the mouse or with the keyboard?

      With the mouse there is no other method than pressing primary must button, hold it and drag.
      With the keyboard you have to go first to column 1 with key HOME which maybe must be pressed twice if the line starts with spaces/tabs and you have not enabled setting Home key always go to column 1 and you are currently not at the first non white-space character in the line. Next you have to press Shift+End to select from current cursor position to end of the line.

      The best solution for you would be maybe to use a macro, stored in a macro file which is automatically loaded on startup of UE, with a hotkey associated to this macro for fast execution whenever you want to select whole content of a non empty line. The macro code would be:

      HexOff
      UnixReOff
      Find RegExp Up "%"
      IfNotFound
      Top
      EndIf
      IfCharIs 13
      ExitMacro
      EndIf
      IfCharIs 10
      ExitMacro
      EndIf
      IfEof
      ExitMacro
      EndIf
      Find RegExp Select "$"
      IfNotFound
      SelectToBottom
      EndIf

      You could use instead of the UltraEdit regular expression engine also the Unix or the Perl engine. Just replace UnixReOff by UnixReOn or PerlReOn and % by ^ and the macro will work with the other regex engines too. This macro always selects whole content of a line, independent on soft-wrapping on/off.

      The macro property Continue if a Find with Replace not found or Continue if search string not found must be checked for this macro.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Aug 27, 2008#3

        Thanks Mofi! That worked :)

        The only problem now would be juggling w/ another MACRO (select line, transform thru another MACRO, copy, etc, repeat process) :(

        I wished UE had a built-in keyboard/mouse command for this function, though (at the same time, addressing the second issue I raised). Or a toggle to allow inclusion/exclusion of hard break/newline. Some of my regular tasks involve copying content from one source and inserting it to another and one of these tasks is very straightforward (no need to understand the context of the content), thus allowing a macro to reformat and isolate lines of text. What I have recently discovered (right after I post this topic) is replace the hard break/newline w/ line feed [0x0D 0x0A -> 0x0C], allowing selection of whole line (either by clicking at the line number at left or triple-clicking at the line of text) w/o the hard break/newline.

        Anyways...

        Thanks again :)

        344
        MasterMaster
        344

          Aug 27, 2008#4

          Hi seatrotter,

          everything you need is built in UE.
          With "PlayMacro ...." you can call other macros from within a macro.
          There is LOOP and ENDLOOP to repeat things
          You can switch between different clipboards with "CLIPBOARD [0-9]" for not overwriting current clipboard (0).

          rds Bego
          Normally using all newest english version incl. each hotfix. Win 10 64 bit