dd question

fred smith fredex at fcshome.stoneham.ma.us
Fri Dec 10 20:49:13 UTC 2010


On Fri, Dec 10, 2010 at 01:57:49PM -0500, William Stock wrote:
> On Thu, 2010-12-09 at 22:41 -0500, fred smith wrote:
> > On Fri, Dec 10, 2010 at 03:11:25AM +0000, Amadeus W.M. wrote:
> > > I have a binary file with data. Each block of 48 bytes is a record. I 
> 
> > >cut
> 
> > however this is a text file with newlines,... if it has no newlines
> > your mileage may vary. in that case you could try some sed or awk
> > hacks to insert newlines after each 48 bytes then feed it to cut.
> 
> Of course if the *binary* file has a 0x0a in it somewhere you'd be in
> deep doodoo. You can't ASS-U-ME anything.  Been there, been bit.

yeah. a short & sweet C program would be almost trivial, too.
(an exercise for the reader! :))

-- 
---- Fred Smith -- fredex at fcshome.stoneham.ma.us -----------------------------
  "And he will be called Wonderful Counselor, Mighty God, Everlasting Father,
  Prince of Peace. Of the increase of his government there will be no end. He 
 will reign on David's throne and over his kingdom, establishing and upholding
      it with justice and righteousness from that time on and forever."
------------------------------- Isaiah 9:7 (niv) ------------------------------


More information about the users mailing list