home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / ckscripts / concatenate < prev    next >
Text File  |  2020-01-01  |  630b  |  24 lines

  1. ; concatenate
  2. ;
  3. ; Concatenate all the files in the current directory into one big file.
  4. ; Useful, e.g., with EDI transaction files that you have just downloaded.
  5. ;
  6. ; Hint: Add this code to the end of an FTP or Kermit download script.
  7.  
  8. def result newfile.edi    ; filename for result file.
  9. if exist \m(result) exit 1 \m(result) already exists.
  10. echo Concatenating files to \m(result)...
  11. echo
  12. dir /array:&a *           ; Get list of files
  13. for \%i 1 \fdim(&a) 1 {
  14.     xecho \%i. \&a[\%i] (\fsize(\&a[\%i]))...
  15.     copy /append \&a[\%i] \m(result)
  16.     if fail stop 1 APPEND FAILED
  17.     echo OK
  18. }
  19. echo
  20. echo Done:
  21. dir \m(result)
  22. echo
  23. end
  24.