Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing binary files

Status
Not open for further replies.

zjeriet

Programmer
Apr 17, 2009
2
BE
Hello,

I've started to write my first TCL script yesterday and it worked quiete well. Except for one issue.
I need to parse a binary file.
So I need to find a certain combination of chars in the file, replace them and save the file.
I used a while{![eof $fid]} construct but the problem is the binary file contains eof chars so that the file is only parsed partially.
Does any of you guys have a good alternative to parse the complete file?

Thanks and regards,

zjeriet
 
Hello,

I used the fconfigure command and it seems to work.

fconfigure $r_id -translation binary

This ignores the eof characters.
Thanks for your help !

greets
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top