Merging files

Merging files

4
NewbieNewbie
4

    Mar 30, 2005#1

    I am trying to write a macro that would merge all the open files into one long file...

    3
    NewbieNewbie
    3

      Mar 31, 2005#2

      Should work like this :

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      ClearClipboard
      Clipboard 1
      Loop 2
      StartSelect
      Key Ctrl+END
      EndSelect
      CopyAppend
      NextWindow
      EndLoop
      NewFile
      Paste

      But you have to tell the macro how many files there
      are to merge (Loop X)

      206
      MasterMaster
      206

        Mar 31, 2005#3

        This might give you some ideas: How do you run a Macro on open files?

        4
        NewbieNewbie
        4

          Mar 31, 2005#4

          I don't have copyappend--I must have an older version (8.00b)?? When I tried to write the Macro, I kept getting stuck in an endless loop because I used NextWindow instead of known iterations--I don't suppose there is an "IfLastWindow" command that I am missing?

            Mar 31, 2005#5

            Ok--after I complained about the old version--they gave me 10.20d+--so I think that I have that problem solved....

            6,683583
            Grand MasterGrand Master
            6,683583

              Mar 31, 2005#6

              Try this macro. It simply close each opened file after copying the content to clipboard and exits the loop, when no named file is open any more.

              InsertMode
              ColumnModeOff
              HexOff
              UnixReOff
              Clipboard 1
              ClearClipboard
              Loop
              SelectAll
              CopyAppend
              CloseFile
              IfNameIs ""
              ExitLoop
              EndIf
              EndLoop
              NewFile
              Paste
              ClearClipboard
              Clipboard 0
              Best regards from an UC/UE/UES for Windows user from Austria

              4
              NewbieNewbie
              4

                Mar 31, 2005#7

                Thanks, Mofi--I took your Macro and added some stuff for my needs and it works wonderfully.