File split on hex string

Discussion in 'Freeware' started by zmaki, Mar 2, 2006.

  1. zmaki

    zmaki Guest

    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
     
    zmaki, Mar 2, 2006
    #1
    1. Advertisements

  2. 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!)===
     
    B. R. 'BeAr' Ederson, Mar 2, 2006
    #2
    1. Advertisements

  3. zmaki

    zmaki Guest

    Thanks a lot.

    It works flawlessly in XP command prompt window.

    zmaki
     
    zmaki, Mar 6, 2006
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Perfora’tus [Stu]

    search and replace hex data in multiple files?

    Andreas Perfora’tus [Stu], Aug 7, 2003, in forum: Freeware
    Replies:
    1
    Views:
    1,206
    Andreas Perfora’tus [Stu]
    Aug 7, 2003
  2. *ProteanThread*

    HEX

    *ProteanThread*, May 17, 2004, in forum: Freeware
    Replies:
    1
    Views:
    226
  3. David

    Hex editor?

    David, Aug 2, 2004, in forum: Freeware
    Replies:
    3
    Views:
    229
    Peter
    Aug 10, 2004
  4. .icy

    Hex editor

    .icy, Nov 18, 2004, in forum: Freeware
    Replies:
    0
    Views:
    262
  5. Vic Dura

    Nice binary-file Hex Editor

    Vic Dura, Jan 13, 2005, in forum: Freeware
    Replies:
    1
    Views:
    515
    (ProteanThread)
    Jan 14, 2005
Loading...

Share This Page