In order for me to complete or ask any questions with my script, I was wondering weather awk
can read a bin file, just like perl can using the "open" cmd and if so how can this be done.
[tt]awk[/tt] can read any file. If your problem is reading just a part of the file and there is no separator, your problem seems to be similar to mine, asked in thread271-1114091. The only problem would be, that the solution is [tt]gawk[/tt] specific.
0000000 H 7 t p r + : 0 9 d s 1 7 S F T
0000010 0 0 0 0 a a a a a a a a a a a a
0000020 a a a a a a a a a a 7 81 \0 \0 \0 \0
0000030 01 # 01 \b 92 ª ª
0000040 06 04 15 13 U 16 01 #
0000050 & ! 96 ª ª ª ª ª ª ª ª ª ª ª ª ª
0000060 ª ª ª \0 \0 04 S S P \0 \0 & ¬
0000070 \0 \0 \0 7 81 \0 \0 \0 \0 01 # 01 \b 92 ª ª
0000080
0000090 06 04 15 13 U B 01 # & ! 96 ª ª ª ª
00000a0 ª ª ª ª ª ª ª ª ª ª ª ª \0 \0 04
00000b0 S S P \0 \0 & ¬ \0 \0 \0 0 v t p
00000c0 r + : 0 9 d s 1 7 S F T 0 0 0 0
00000d0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0
00000e0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0
00000f0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0
0000100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0000110 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0
0000120 0 0 0 0
1) the first 42bits is the header when converted to ascii is show above
2) The actual record always starts with 3781 or 0037 8100 and converted starts with 7 81|82|83 etc
3) the trailer starts with 5476 and when converted to ascii is show above till the end.
The result for eg : should look something like this
==========================================
H 7 tpr+:09 ds17 SFT 0000
aaaaaaaa aaaaaa aaaa aaaa
7 81 0?????????aaaa 20060421201237 0?????????????aaaa 000143 002184 S 01 00034a5b V J5#1 31
7 81 0?????????aaaa 20060421211133 0?????????aaaaaaaa 000072 003269 S 01 0058595b V B 2 31
T v tpr+:09 ds17 SFT
00000002 0000000000000
00000002 0000000000000
00000002 0000000000000
00000002 0000000000000
0000
Abit more clear now. I belive that the problem could be solved with an improved implementation of [tt]awk[/tt], like [tt]gawk[/tt], maybe [tt]nawk[/tt], but I would not try it. [tt]awk[/tt] is too much text oriented.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.