Transform Column

Transform Column

2
NewbieNewbie
2

    Apr 27, 2010#1

    Hi!"
    I'm a beginner with UE and i've got only a trial version for testing.

    Is it possible to do the following transforming?

    header A
    data 1a
    data 2a
    ...
    header B
    data 1b
    data 2b
    ...

    transform in:

    header A header B ...
    data 1a data 1b ...
    data 2a data 2b ...
    ... ... ...

    Is it possible?
    How does it work?

    Thank you for reply!
    Eskimo
    :?

    236
    MasterMaster
    236

      Apr 27, 2010#2

      This is certainly possible. The complexity of the solution (assuming you want a fully automated one) depends on a few factors, though. For instance, is the length of the sections (=number of lines between headers) constant and known in advance?

      2
      NewbieNewbie
      2

        May 03, 2010#3

        Thanks!
        The length of the sections is constant and known.
        How does ist work?

        236
        MasterMaster
        236

          May 03, 2010#4

          The most elegant solution would probably be using a script. I'm not a JavaScript guy, so I can't show you how to do that (I prefer Python for this kind of work).

          But you could also do it using a macro. The only conditions are:
          1. The first header has to be longer than all following lines of the first section, or characters will get mixed. After that, line lengths don't matter. (It's possible to augment the macro so that line lengths don't matter for the first section, but let's not get carried away now :))
          2. There has to be an empty line at the end. Otherwise the macro will never stop.

          This macro works on an example file where each section including headers is four lines long:

          Code: Select all

          InsertMode
          ColumnModeOff
          HexOff
          Loop 0
          Key Ctrl+HOME
          Key DOWN ARROW
          Key DOWN ARROW
          Key DOWN ARROW
          Key DOWN ARROW
          IfEof
          ExitLoop
          EndIf
          StartSelect
          Key DOWN ARROW
          Key DOWN ARROW
          Key DOWN ARROW
          Key DOWN ARROW
          EndSelect
          Cut
          Key Ctrl+HOME
          Key END
          " "
          ColumnModeOn
          Paste
          ColumnModeOff
          EndLoop
          For more lines, add more "Key DOWN ARROW" lines.

          This macro will transform

          Code: Select all

          header A
          data 1ad
          data 2a
          ...
          header B
          datatest 1b
          data 2b
          ...
          header C
          data 1c
          datalonger 2c
          ...
          header D
          data 1d
          data 2d
          ...
          
          to

          Code: Select all

          header A header B    header C      header D
          data 1ad datatest 1b data 1c       data 1d 
          data 2a  data 2b     datalonger 2c data 2d 
          ...      ...         ...           ...