Tapatalk

Saving each line to an extra file

Saving each line to an extra file

1
NewbieNewbie
1

    Jun 28, 2007#1

    Is there a way of making f.e. 25 files from 1 file having 25 lines (with cons. numbers ?)

    6,685587
    Grand MasterGrand Master
    6,685587

      Jun 29, 2007#2

      For auto saving the new files with an increasing number you must FIRST create my universal CountUp macro. The source code with description can be found at counter or compiled in the macro files in the zip archive you can download at Macro examples and reference for beginners and experts.

      THEN create the following macro. You have to adapt the red highlighted filename with path. If you think you will not produce more than 999 files, you can modify all 0000 to 000 or less (00 should be also enough for you).

      Make sure you have only your source file open or it is the most right one in the file tab order because of possible problems with setting Move to nearest left tab after current tab is closed.

      The following macro is a simple version of the macro posted at Splitting Big Files.

      InsertMode
      ColumnModeOff
      HexOff
      Bottom
      IfColNum 1
      Else
      "
      "
      EndIf
      Top
      "0000"
      SelectToTop
      Clipboard 8
      Cut
      Clipboard 9
      Loop
      SelectLine
      IfSel
      Cut
      EndSelect
      NewFile
      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 0
      Best regards from an UC/UE/UES for Windows user from Austria