On Thu, 08 Dec 2005 15:52:00 -0500, Albert Latuch wrote:
>I have a need to parse an EBCDIC file that has variable
>length records. ...
>The first four bytes (in hex) tell the length of the
>follow-on record. i.e.
>...
>My ultimate goal is to be able
>to break the data first into records, then into labeled fields.
Albert:
Welcome to VEDIT and to this forum!
The first part of your problem could be solved with something like
this:
Begin_Of_File
while (! At_EoF) {
Reg_Set(103, "0x") // make the following bytes a hex number
Reg_Copy_Block(103, Cur_Pos, Cur_Pos+4, DELETE) // cut 4 bytes
#103=Num_Eval_Reg(103) // evaluate number from that hex-string
Char(#103) // forward that number of characters
Ins_Newline(1) // insert an End-Of-Line
}
That way it's written for text, no binary.
And I don't know anything about EBCDIC...
But perhaps it may be used as starting point.
Christian