 ファイル分割

＜概要＞
　ファイルを指定されたサイズに分割します。元通り結合するバッチファイルも生成します。

＜前提条件・制限＞
　このREXXについては、OS/2だけでなく、PC-DOS 7.0/VのREXXでも動作可能なようにコーディングし、動作確認しました。その他のOSについては、環境がないためテストしてません。
　ファイル名は、DOSの8.3形式で指定してください。
　分割したファイルは、元のファイルの拡張子を連番に、バッチファイルは拡張子をBATに変えたものです。バッチファイルの中のコマンドが長すぎて実行できないかもしれません。m(..)m
　生成されるファイル名と重なるため、元のファイル名がBATあるいは数字のみのものはサポートしません。
　拡張子に連番を振るため、分割した結果が999を越える場合はエラーにしてます。
　以上の制限は、外そうと思えば外せるかもしれませんが、コーディングが面倒なのでそのままにしてあります。(^^;

＜インストール＞

    ソースをパスの通ったディレクトリにデータファイルとしてコピーします。 

＜パラメータ＞
filecut[.cmd] [-size nnn] ファイル名
　-size の次に分割するサイズをkバイト単位で指定します。デフォルトは1350（kバイト）です。ファイル名は、DOSの8.3形式で指定してください。

＜実行＞
　OS/2コマンドプロンプトから実行してください。

例：
[F:\]filecmd -size 720 test1.lzh
Cutting file test1.lzh
Writing test1.001
Writing test1.002
Creating batch file test1.bat

[F:\]

　生成されるバッチファイル（test1.bat）の内容は、以下のようになります。
copy /b test1.001 /b + test1.002 /b test1.lzh 


ENGLISH TRANSLATION WITH GOOGLE
---------------------------------
File division

<Overview>
Divide the file into the specified size. It also generates a batch file that merges back together.

<Prerequisites and Restrictions>
　This REXX was coded so that it could work not only on OS/2, but also on REXX of PC-DOS 7.0/V, and its operation was confirmed. I have not tested other OS's because I don't have the environment.
Please specify the file name in DOS 8.3 format.
The split files have the extension of the original file as a serial number, and the batch file has the extension changed to BAT. A command in a batch file may be too long to execute. m(..)m
　Because it overlaps with the generated file name, we do not support original file names with BAT or numbers only.
Since the extension is assigned a sequential number, if the result of division exceeds 999, an error will occur.
You may be able to remove the above restrictions if you want, but the coding is troublesome, so I left them as they are. (^^;

<Installation>

    Copy the source to a directory in your path as a data file.

<Parameter>
filecut[.cmd] [-size nnn] filename
Specify the size to be divided after -size in units of k bytes. The default is 1350 (k bytes). Specify the file name in DOS 8.3 format.

<Execute>
　Execute from the OS/2 command prompt.

example:
[F:\]filecmd -size 720 test1.lzh
Cutting file test1.lzh
Writing test1.001
Writing test1.002
Creating batch file test1.bat

[F:\]

The contents of the generated batch file (test1.bat) are as follows.
copy /b test1.001 /b + test1.002 /b test1.lzh

LINK
https://web.archive.org/web/20041119174321/http://www2u.biglobe.ne.jp/~gwm01021/rexx7-1.htm