Splitting file in half

Splitting file in half

24
Basic UserBasic User
24

    Jun 22, 2013#1

    I'm trying to make a simple macro. I didn't succeed so far. The problem lies on selecting the lines I want/need, then reallocate it to start of it (almost as splitting in half).

    Example:

    Code: Select all

    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    01 = 1000
    02 = 2000
    03 = 3000
    04 = 4000
    05 = 5000
    Result should be:

    Code: Select all

    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    01 = 1000                          01 = 1000
    02 = 2000                          02 = 2000
    03 = 3000                          03 = 3000
    04 = 4000                          04 = 4000
    05 = 5000                          05 = 5000
    Of course, the number changes all the time, this is just an example, but normally I only need to keep the first 50 numbers in place, and then split from 51 to 100.

    Any help is welcome.

    6,686585
    Grand MasterGrand Master
    6,686585

      Jun 23, 2013#2

      For your example the macro was very easy to record.

      Code: Select all

      InsertMode
      ColumnModeOff
      HexOff
      Clipboard 9
      GotoLine 51 1
      SelectToBottom
      Cut
      Top
      Key END
      "                          "
      ColumnModeOn
      Paste
      ColumnModeOff
      Top
      TrimTrailingSpaces
      ClearClipboard
      Clipboard 0
      But please note that UltraEdit macros do not support variables and calculations with variables. So the macro can be used only for files with 100 lines. A dynamic adaptation for files with other number of lines would be possible only with an UltraEdit script, but not with a macro.

      24
      Basic UserBasic User
      24

        Jul 02, 2013#3

        Thanks a lot Mofi.

        I'm aware of the limit, this is what I need at the moment.

        Regards