how to jump to a variable line number

how to jump to a variable line number

1

    Feb 01, 2006#1

    I want to read a number from a file test.txt and jump to that line number f.e.:
    test.txt:
    lets jump to line: 30
    ...

    How do I solve this problem?

    6,615550
    Grand MasterGrand Master
    6,615550

      Feb 02, 2006#2

      Sorry, but this is not possible without a trick. The trick is to add the line number on every line of the file and use a normal find to go to the line with the variable line number. Now you can modify the line. Finally all line numbers added will be removed.

      InsertMode
      HexOff
      Add your macro code here to copy the line number into the clipboard. This can be also an UltraEdit user clipboard if you don't want to loose the content of your windows clipboard.
      ColumnModeOn
      UnixReOff
      Top
      SelectToBottom
      StartSelect
      Key HOME
      Key HOME
      "MOFI"
      Top
      EndSelect
      ColumnInsertNum 1 1 LeadingZero
      ColumnModeOff
      Find MatchCase "^cMOFI"
      Here insert your macro code. You can also use UnixReOn for Unix style regular expression if you prefer it. But then also the last RegExp must be edited to "^[0-9]*MOFI".
      Top
      Find RegExp "%[0-9]+MOFI"
      Replace All ""

      The "MOFI" string is important to make sure that not a number is deleted which was already at start of a line before adding the line numbers and to find really the line number and not any other number in the file. Of course you can also use any other string which does not exist in your file at start of any line.

      And don't forget to enable the macro property Continue if a Find with Replace not found.

      I hope your file is not too large or the macro will be a little bit slow on execution because of inserting and removing the line numbers.
      Best regards from an UC/UE/UES for Windows user from Austria