Tool to uncat file

Matthew Seaman m.seaman at infracaninophile.co.uk
Sun Feb 1 10:47:04 PST 2009


Polytropon wrote:
> Dear list,
> 
> before starting to code on my own, I'd like to ask if there's already a
> tool to uncat files, defining the file separation position as a string
> of bytes, usually given in hexadecimal form.
> 
> An example could be this:
> 
> 	% uncat -p 0x12,0x52,0xf1,0x09 file_orig
> 
> It creates file_1 file_2 file_3. And, of course,
> 
> 	% cat file_1 file_2 file_3 > file_orig
> 
> would re-create the original file. The bytes 0x12,0x52,0xf1,0x09 tell the
> file starting pattern (-p), where a new file begins.
> 
> I cannot use dd due to the fact that the files concatenated are of a
> different size. So the idea would be to look for specific byte pattern
> and then start a new file each time it occurs on input.
> 
> Is there such a tool, or any other ideas?

csplit(1)

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20090201/a8c17c22/signature.pgp


More information about the freebsd-questions mailing list