On Tue 2010-10-19 15:08:45 UTC+0200, Matthias Apitz (g...@unixarea.de) wrote:
> Before I programm it in C (or whatever), is there any normal shell tool > to filter a (large) binary file and change any occurance of 0x150a to > 0x15 (i.e. delete \n but only if it follows a char 0x15)? I'd be personally more comfortable doing it in C or Python but I think you can do this with tr -s. Note: 0x15 == 25 octal; 0x0a == 12 octal. I don't recall if it's possible to use hex values in csh arguments - if so, what is the syntax? 0:28 ozzmo...@blizzard [~/tmp]printf 'Hello\25\12world.\12' > blah 0:28 ozzmo...@blizzard [~/tmp]hd blah 00000000 48 65 6c 6c 6f 15 0a 77 6f 72 6c 64 2e 0a |Hello..world..| 0000000e 0:28 ozzmo...@blizzard [~/tmp]tr -s '\25\12' '\25' < blah | hd 00000000 48 65 6c 6c 6f 15 77 6f 72 6c 64 2e 15 |Hello.world..| 0000000d Regards Andrew _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"