Name: Magnus G Date: January 22, 2003 at 12:30:59 Pacific Subject: How to edit a binary file ? OS: OpenVMS 6.2 CPU/Ram: Vax 4000-90 with 80 MB
Comment:
Hi, I would like to edit a binary file, it is a HPGL plot file extension *.hpp that I would like to add (append) some esc. codes and text to ? How can I do that and still keeping the file format for printing ? In the editor (EDT in this case) I will lose the record length... My brain is lost in space... Any idea someone...?
Please is there anyone who could give me a hint... or tell me to be more specific in my question maybe ? I am trying with the old EDT editor but so far no luck, I have FORTRAN 77 installed on this computer if someone can give me an idea using that... My thoughts so far is to find a way how change the fixed lenght of the HPGL/2 file to be able to edit it and maybe then add the change I want to make and then convert it back to original format for printing...
I'm not sure if I understand your problem. Maybe you could post a "DIR /FULL" of the unedited and edited file?
Have you tried to edit it with TPU ? When you do a 'set keypad edt' as first editor command, it will be like edt.
Have you tried to convert it with a FDL of the unedited file ? so : $ ANALYZE /RMS /FDL myfile.hpp $ EDT myfile.hpp *EXIT $ CONVERT /FDL=myfile.fdl myfile.hpp newfile.hpp
Have you looked at the SET FILE /ATTRIBUTE command ?
I have after received some corrupted files in the HPGL format, but that is an other story... finally got a solution.
The HPGL file is with fixed length 512 byte records and file organization is sequential (using DIR/FULL). I can not use edit, that is still a question? Records are too big and will be truncated to 255 characters but my first goal was to append some strings and that is achieved.
Thank You ME for giving me the good advice to use convert.
With CONVERT/APPEND/PAD="NULL" append_file old_hpgl.hpp - where the append_file is my stuff for adding some lines just containing some text and esc codes (using EDT) to the old file and fill it with null characters, the result is ok! That means it is printable and looks perfect.
I will "dig" some more to see if I can in some way also convert it for direct editing? Using the suggestions You gave me ME, thanks again!
EDT only supports files with a maximum record length of 255. So unless you write a program that chops the records in half, it is unusuable. TPU supports files with a much longer record length (4096 ?). So that may be an option to edit them direct. If you set the keypad to EDT it will look quite similar (although slower) like EDT :
$ EDITX /TPU myfile.hpp
Then hit the top right key at the numeric keypad (PF4/the minus), and type : SET KEYPAD EDT
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE