Computing.Net > Forums > OpenVMS > How to edit a binary file ?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to edit a binary file ?

Reply to Message Icon

Name: Magnus G
Date: January 22, 2003 at 12:30:59 Pacific
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...?

Best Regards, Magnus




Sponsored Link
Ads by Google

Response Number 1
Name: Magnus G
Date: January 24, 2003 at 14:25:53 Pacific
Reply:

Hi again,

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...

Best Regards,
Magnus


0

Response Number 2
Name: ME
Date: January 25, 2003 at 19:18:06 Pacific
Reply:

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 ?


0

Response Number 3
Name: Magnus G
Date: January 27, 2003 at 14:12:42 Pacific
Reply:

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!


0

Response Number 4
Name: ME
Date: January 29, 2003 at 11:49:30 Pacific
Reply:

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


0

Response Number 5
Name: BiHappy
Date: January 30, 2003 at 03:33:56 Pacific
Reply:

Hello Magnus,

What you could try is the following,
First save the File Definition of the file with

ANALY/RMS YOURFILE.HPP /FDL
This creates a YOURFILE.FDL
Now edit the file with your favorite editor ;-)) and save it.
Then

CONVERT /FDL=YOURFILE.FDL YOURFILE.HPP YOURNEWFILE.HPP
This should restore the file definitions to the orginal file.....

Hope this will work,
Goodluck,
Jo


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to OpenVMS Forum Home


Sponsored links

Ads by Google


Results for: How to edit a binary file ?

editing a txt file using a com file www.computing.net/answers/openvms/editing-a-txt-file-using-a-com-file/518.html

VMS binary file conversion to dos www.computing.net/answers/openvms/vms-binary-file-conversion-to-dos/281.html

Add header in a binary file in Open www.computing.net/answers/openvms/add-header-in-a-binary-file-in-open/525.html