From owner-freebsd-questions@FreeBSD.ORG Sun Feb 1 13:01:16 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EF371065674 for ; Sun, 1 Feb 2009 13:01:16 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 0F4228FC19 for ; Sun, 1 Feb 2009 13:01:15 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r55.edvax.de (port-92-196-52-176.dynamic.qsc.de [92.196.52.176]) by mx01.qsc.de (Postfix) with ESMTP id 79CF93CF43 for ; Sun, 1 Feb 2009 14:01:11 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id n11D12dt002522 for ; Sun, 1 Feb 2009 14:01:02 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sun, 1 Feb 2009 14:01:02 +0100 From: Polytropon To: FreeBSD Questions Message-Id: <20090201140102.e9a9a41a.freebsd@edvax.de> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Tool to uncat file X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 13:01:16 -0000 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? -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...