1
NewbieNewbie
1

    Aug 20, 2013#16

    This almost solves my splitting big files task, except I need to retain the header row (line 1) for each iteration how can the code be modified to accomplish this?

    Thanks
    alG

    6,675585
    Grand MasterGrand Master
    6,675585

      Aug 20, 2013#17

      Well, there are several macros posted on first page of this topic. So I don't know which one you want to modify.

      However, the macros have at top the code sequence

      Clipboard 8
      Cut
      Clipboard 9


      which needs to be modified for your task of replicating the first line of the file into all other files to

      Clipboard 8
      Cut
      Clipboard 7
      SelectLine
      Cut
      Clipboard 9



      And the second code block to modify is

      NewFile
      Paste
      Top


      which must be modified to

      NewFile
      Clipboard 7
      Paste
      Clipboard 9
      Paste
      Top



      And at end of the macro before last command switching to Windows clipboard it would be good to insert the two lines

      Clipboard 7
      ClearClipboard


      to clear also the header line from user clipboard 7.

      Those modifications applied to first posted macro results in

      InsertMode
      ColumnModeOff
      HexOff
      Bottom
      IfColNum 1
      Else
      "
      "
      EndIf
      Top
      "0000"
      SelectToTop
      Clipboard 8
      Cut
      Clipboard 7
      SelectLine
      Cut

      Clipboard 9
      Loop
      GotoLineSelect 25001 1
      IfSel
      Cut
      EndSelect
      NewFile
      Clipboard 7
      Paste
      Clipboard 9

      Paste
      Top
      "C:\Temp\Test_0000.tmp
      "
      Key UP ARROW
      Find "0000"
      Clipboard 8
      PlayMacro 1 "CountUp"
      Key HOME
      StartSelect
      Key END
      Clipboard 9
      Copy
      EndSelect
      DeleteLine
      SaveAs "^c"
      CloseFile
      Else
      ExitLoop
      EndIf
      EndLoop
      CloseFile NoSave
      Clipboard 9
      ClearClipboard
      Clipboard 8
      ClearClipboard
      Clipboard 7
      ClearClipboard

      Clipboard 0

      I want to add that nowadays with UltraEdit scripting support where it is possible to use variables, a scripting solution like posted at Split up large file based on line number count is usually the better method to do a file splitting.

      Read more posts (-13 remaining)