Hierarchy replace

Hierarchy replace

1
NewbieNewbie
1

    Jan 09, 2006#1

    I have a text file that has an embedded hierachy
    Table: table1
    Column1
    Column2
    ..
    Table: table2
    Column1
    Column2
    ..

    I want to get to
    table1 column1
    table1 column2
    table2 column1
    table2 column2

    6,683583
    Grand MasterGrand Master
    6,683583

      Jan 09, 2006#2

      This macro modifies the example you post like you want:

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Bottom
      "Table:
      "
      Top
      Clipboard 9
      Loop
      Find RegExp "%Table: "
      Delete
      StartSelect
      Key END
      Cut
      EndSelect
      Key DEL
      StartSelect
      Find RegExp Select "%Table: "
      IfSel
      Key UP ARROW
      Key END
      Find RegExp "%"
      Replace All SelectText "^c "
      EndSelect
      Key DOWN ARROW
      Key HOME
      Else
      ExitLoop
      EndIf
      EndLoop
      ClearClipboard
      Clipboard 0
      UnixReOn

      Remove the last red command, if you use regular expression in UltraEdit style by default instead of Unix style.
      For UltraEdit v11.10c and lower see Advanced - Configuration - Find - Unix style Regular Expressions.
      For UltraEdit v11.20 and higher see Advanced - Configuration - Searching - Unix style Regular Expressions.
      Macro commands UnixReOn/UnixReOff modifies this setting.

      And don't forget to enable the macro property Continue if a Find with Replace not found.
      Best regards from an UC/UE/UES for Windows user from Austria