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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output number to file

Status
Not open for further replies.

Eric2015

Technical User
Nov 14, 2009
1
CN
i have a text of a binary file , i want to return to binary file.
=============================================================
00000000: 1f 8b 08 00 00 00 00 00 00 03 74 fc 75 5c 94 5d ..........t.u\.]
00000010: d7 3e 0e 9f 33 0c 8d 30 74 49 49 83 74 8b 4a 83 .>..3..0tII.t.J.
00000020: 74 77 23 0d 03 48 2a 39 84 4a 87 74 49 77 4a 87 tw#..H*9.J.tIwJ.
00000030: 94 84 34 88 74 83 08 48 0b 48 48 cc 6f e0 7e 9e ..4.t..H.HH.o.~.
00000040: ef 75 bf d7 f3 79 e7 8f d1 d9 73 9e fb 38 d7 b1 .u...y....s..8..
============================================================
this is my script:

cat file | awk '{
for( n=2; n<=17; n++ )
{
data_str = sprintf("0x%s ", $n)
data = strtonum(data_str)
}
}'

My problem is how to output the var <data> to file, if i use
print or printf it will converted to string ,but i want the number not string.



 
Have you tried this ?
printf "%c",data

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top