PC Review


Reply
Thread Tools Rate Thread

File split on hex string

 
 
zmaki
Guest
Posts: n/a
 
      2nd Mar 2006
Please help :

Need to split big file into many small files (chunks).

Each chunk should start on the same hex-string, and end immediately before
next such hex-string in big file, where new chunk should start. Chunks
should be automaticaly sequentially named and saved.

Is there any freeware/shareware program, where I can select big file, enter
hex-string, and program will do the above described procedure automatically
?

zmaki


 
Reply With Quote
 
 
 
 
B. R. 'BeAr' Ederson
Guest
Posts: n/a
 
      2nd Mar 2006
On Thu, 2 Mar 2006 07:57:51 +0100, zmaki wrote:

> Need to split big file into many small files (chunks).
>
> Each chunk should start on the same hex-string, and end immediately before
> next such hex-string in big file, where new chunk should start. Chunks
> should be automaticaly sequentially named and saved.
>
> Is there any freeware/shareware program, where I can select big file, enter
> hex-string, and program will do the above described procedure automatically


Clay Ruth has a DOS and a Win32(Beta) command line utility which both
do what you want. You can download them here:

http://n9cr.redirectme.net/claysutl.html

Please note that the programs work directly on the original (your input
file)! And both only do one split on one run. To do multiple splits
you may want to write a batch to do the repetitive calls of the split
program. A sample:

----------- Copy to a_split.bat -------------
set trg=1000
copy %1 %1.%trg%
:next
set /A "trg+=1"
set /A "src=trg - 1"
Split32.exe %1.%src% %1.%trg% %2
if not errorlevel 1 goto next
---------------------------------------------

You need to call the above batch with the file to be split and the split
string as parameters, for instance:

a_split the_big_one.dat "^x00^xFF"

This should split your file the_big_one.dat right before each 00FFh
byte sequence - creating the files

the_big_one.dat.1000
the_big_one.dat.1001
the_big_one.dat.1002
:

If you don't need to recombine your files, than you can start the counter
with 0 (instead with 1000). I only chose 1000 because recombination is
easier when all numbers have the same count of digits.

If you're on a Win9x based system, you'll need a replacement for the
internal Set command to do arithmetic with environment variables. I
like ASet by Richard Breuer:

http://www.ricki.de/index-e.html

It is part of the Rutils40 package.

HTH.
BeAr
--
===========================================================================
= What do you mean with: "Perfection is always an illusion"? =
===============================================================--(Oops!)===
 
Reply With Quote
 
 
 
 
zmaki
Guest
Posts: n/a
 
      6th Mar 2006
Thanks a lot.

It works flawlessly in XP command prompt window.

zmaki


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String.Split(), Regex.Split() - empty String Rico Microsoft C# .NET 3 27th Jun 2005 04:26 PM
How do you get hex zeros and hex FF into a variable Tony Girgenti Microsoft Access Form Coding 6 14th Oct 2003 01:39 PM
How to get hex zeros or hex FF into a string ? Tony Girgenti Microsoft Access Form Coding 5 12th Oct 2003 04:40 AM
Adding leading zero to convert one digit hex values like 0,1,2,A in to two 2 digit hex values like 01,02,0A Rich Microsoft Access Queries 1 22nd Sep 2003 10:34 PM
Convert a string value representing an HEX ....into a real HEX value Filippo Microsoft C# .NET 2 1st Aug 2003 07:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:36 PM.