Search Results

Search: Posts Made By: dhiraj4mann
3,329
Posted By Ygor
Try using dd to convert the file, e.g....$ printf...
Try using dd to convert the file, e.g....$ printf "abc\000\000\000de\000" >file1

$ dd if=file1 of=file2 cbs=3 conv=unblock
0+1 records in
0+1 records out
12 bytes (12 B) copied, 0 s, Infinity...
3,329
Posted By alister
Assuming the file's content is an integral number...
Assuming the file's content is an integral number of records, Corona688's solution will encounter the EOF during the first attempt to read in a new record. At that point, bpos is 0 and there's...
3,329
Posted By Chubler_XL
Here is my od-thru-awk solution. I used a...
Here is my od-thru-awk solution. I used a slightly different approach: count the number of zero bytes and if it's < blocksize output the block.

od -tu1 -An -w1 -v your_binary_file | awk '{
...
3,329
Posted By Corona688
Read in chunks with dd, test against a file of...
Read in chunks with dd, test against a file of the same size full of binary zeroes, print if nonzero.
dd if=/dev/zero of=zero bs=31744 count=1

while dd count=1 bs=31744 > test
do
diff...
3,920
Posted By alister
od -An -v -tu1 binfile | tr -cs '[:digit:]'...
od -An -v -tu1 binfile | tr -cs '[:digit:]' '[\n*]' | > binfile.fixed awk '
NR >= r {
if (int($0) == 0)
next
r = NR + 31744
...
3,920
Posted By Chubler_XL
I'm no master of perl but this should do what you...
I'm no master of perl but this should do what you want:

#!/usr/bin/perl
open INFILE, "<", "binary" or die $!;
open OUTFILE, ">", "bin_fixed" or die $!;
binmode INFILE;
binmode OUTFILE;
my...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 06:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy