🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #30574

Utility for joining split files

#30574
From: dlv059
Date: Tue, 26 Jul 1988 18:05
70 lines
3320 bytes
A few weeks ago I posted a question about a problem I was having with joining 
multi-part files that were received from comp.binaries.mac.  I received many 
helpful responses.  To show my gratitude I am here posting a short DCL command 
file that I developed to append the files, strip out comments, and download 
the resulting file to my Mac.  Of course this will only be useful to those of
you who use VMS.

The file JOINER.COM (which has some internal documentation) is executed by
typing @JOINER file, where 'file' is the root name of the multi-part document.
This assumes that you use a naming convention similar to mine. For example, 
the program "Equation Solver" was divided into three parts.  On the VAX, I 
called them EQUATE1.HQX, EQUATE2.HQX, and EQUATE3.HQX.  I joined them by 
typing @JOINER EQUATE, and the file EQUATE.HQX was created and downloaded to 
my Mac.

By the way, on my system, the command "KERMIT" runs the VMS Kermit, and "EDT" 
runs the EDT editor.  Your mileage may differ.

Hope this is helpful for some of you.

--------------------------cut here-----------------------------------------
!This is a short command file to append all the parts of a split .hqx file 
!into one file, edit out all the non-binhexed material, and send the result
!to the Mac via Kermit.  The split files are assumed to be named filen.hqx,
!where 'file' is the root file name and 'n' is the part number.  The required
!argument P1 is 'file', and the joined file will be called file.hqx.
!	NOTE: the edit commands were designed for files received from 
!comp.binaries.mac, and will not work with files from sumex or other archives.
!	--Dave Votaw, Jet Propulsion Lab  (dlv059@ipl.jpl.nasa.gov) 7/26/88
$ copy 'P1'1.hqx 'P1'
$ part = 2	! Assume at least two parts
$LOOP:		! This section finds out how many parts to the file
$ file = p1 + f$string(part) + ".hqx"
$ if F$SEARCH(file) .eqs. "" then goto append
$ part = part + 1
$ goto loop
$APPEND:	! Here we assemble the parts into one file
$ parts = part - 1
$ part = 2
$LOOP2:
$ file = p1 + f$string(part) + ".hqx"
$ append 'file' 'p1'.hqx
$ if part .eq. parts then goto clean
$ part = part + 1
$ goto loop2
$CLEAN:		! Here we clean up the assembled file
$ open/write outfile clean.com		! Create a com file to do it for us
$ write outfile "$ edt/nocom " + p1 + ".hqx"
$ write outfile "delete 1 thru ""---"""		! Removes introductory stuff
$ part = 2
$LOOP3:
$ write outfile "delete "" ---"" thru ""---"""	! Removes between-part stuff
$ if part .eq. parts then goto final
$ part = part + 1
$ goto loop3
$FINAL:
$ write outfile "delete ""---"""		! Removes last line
$ write outfile "exit"
$ close outfile
$ @clean			! Execute the file, then delete it
$ delete clean.com;*
$ open/write outfile ker.com	! Create a command file for Kermit
$ write outfile "send ''p1'.hqx"
$ write outfile "exit"
$ close outfile
$ kermit @ker			! Execute Kermit with command file
$ delete ker.com.
$ exit

Dave Votaw	dlv059@ipl.jpl.nasa.gov
Technical Details
Message-ID: <7722@elroy.Jpl.Nasa.Gov>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!mailrus!ames!elroy!daemon

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!mailrus!ames!elroy!daemon
From: dlv059@Mipl3.JPL.Nasa.Gov
Newsgroups: comp.sys.mac
Subject: Utility for joining split files
Message-ID: <7722@elroy.Jpl.Nasa.Gov>
Date: 26 Jul 88 18:05:42 GMT
Sender: daemon@elroy.Jpl.Nasa.Gov
Lines: 70