home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
m2toolz.zip
/
xlfile.tnl
< prev
Wrap
Text File
|
1999-01-26
|
2KB
|
50 lines
Here's an M2 file translator done in the El Cheapo manner.
There are 2 translate tables that come with it for ASCII-to-EBCDIC
and the inverse. These haven't been tested or fooled with. They've
been 'borrowed' from mainframe tables.
For that kind of translate it's:
XLFILE input-file output-file table-file
Input-file can == Output-file.
If the table-file is given as 'MAPPED', then the remaining command args
are pairs of characters, either hex or as themselves, to be translated
from and to.
For a DOS to UNIX cheapo text conversion:
XLFILE input-file output-file MAPPED 0D 20
which gets an extra blank at the end of the line but removes the carr. return.
or IBM ASCII vertical bar to ASCII vertical bar.
XLFILE input-file output-file MAPPED B3 7C
If the table-file has no path indications (':', '/', or '\' ) then
it is assumed to reside in the same directory as XLFILE.EXE.
For the Blue crowd, two (mutually exclusive) positional parameters are added
called ATEXT or ETEXT which require a fixed record 'size' be specified.
'ATEXT' means the output is intended to be ASCII. 'ETEXT' means the
output is intended to be EBCDIC.
The ATEXT/ETEXT options are mutually exclusive with 'MAPPED'.
Exit codes:
1 - Less than 3 arguments to program.
2 - Translate table load failure.
3 - Input file load failure.
4 - Output file write error.
5 - Unable to open output file.
7 - Unpaired character definition.
9 - Invalid Hexadecimal character specified.
11 - Invalid record length argument.
The code has been repaired to handle files larger than a megabyte.
There was a problem related to the use of DosSubAllocMem by the runtime
which has been repaired.
If a complete path was specified for the translate file all xTEXT specs
were ignored.