Search and Replace then add lines

Search and Replace then add lines

1

    Aug 02, 2004#1

    I would like to create a macro that reads a two digit field in a particular column then insert lines after that count. For example:

    If column 71-72 is 05 add 5 lines after the 05.
    If column 71-72 is 09 add 9 lines....etc

    Has anyone ever tried this.

    thanks 8O

    6,675585
    Grand MasterGrand Master
    6,675585

      Jun 25, 2006#2

      This is not easy because the macro language of UE has no support for variables or math expressions. But this special job can be done with a macro:

      InsertMode
      ColumnModeOff
      HexOff
      Key HOME
      IfColNumGt 1
      Key HOME
      EndIf
      Clipboard 9
      Loop 70
      Key RIGHT ARROW
      EndLoop
      StartSelect
      Key RIGHT ARROW
      Key RIGHT ARROW
      Copy
      EndSelect
      Paste
      " ENDOFINSERTPOINT"
      Key Ctrl+LEFT ARROW
      Key LEFT ARROW
      Key LEFT ARROW
      Loop
      OverStrikeMode
      IfCharIs "0"
      Key LEFT ARROW
      IfCharIs "0"
      ExitLoop
      EndIf
      IfCharIs "1"
      "0"
      Else
      IfCharIs "2"
      "1"
      Else
      IfCharIs "3"
      "2"
      Else
      IfCharIs "4"
      "3"
      Else
      IfCharIs "5"
      "4"
      Else
      IfCharIs "6"
      "5"
      Else
      IfCharIs "7"
      "6"
      Else
      IfCharIs "8"
      "7"
      Else
      IfCharIs "9"
      "8"
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      "9"
      Else
      IfCharIs "1"
      "0"
      Else
      IfCharIs "2"
      "1"
      Else
      IfCharIs "3"
      "2"
      Else
      IfCharIs "4"
      "3"
      Else
      IfCharIs "5"
      "4"
      Else
      IfCharIs "6"
      "5"
      Else
      IfCharIs "7"
      "6"
      Else
      IfCharIs "8"
      "7"
      Else
      IfCharIs "9"
      "8"
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      EndIf
      InsertMode
      "#"
      Key LEFT ARROW
      Key LEFT ARROW
      EndLoop
      InsertMode
      Key DEL
      Key DEL
      Paste
      ClearClipboard
      Clipboard 0
      StartSelect
      Find Select " ENDOFINSERTPOINT"
      Find "#"
      Replace All "^p"
      EndSelect
      Find MatchCase " ENDOFINSERTPOINT"
      Replace ""
      Best regards from an UC/UE/UES for Windows user from Austria