HOWTO: Merge files under Windows

Small “howto”, because I always forget.

Today I needed to merge to Linux tar files on Windows. I downloaded the two Oracle VM Templates for Oracle Business Intelligence Enterprise Edition (OBIEE). After unzipping them you get two tar files called

  • OVM_EL4U5_X86_PVM_10gR3BIEE.tgz.file1of2
  • OVM_EL4U5_X86_PVM_10gR3BIEE.tgz.file1of2

To be able to merge them and then “untar” those files, under Linux or Unix you would do something like:


cat {file01} {file02}  | tar -xvz

cat OVM_EL4U5_X86_PVM_10gR3BIEE.tgz.file1of2 OVM_EL4U5_X86_PVM_10gR3BIEE.tgz.file2of2| tar -xvz
.

…with other words, you would “cat” the first and second file into a file and then “untar”-ed it on the fly via the “tar -xvz”. In Windows you would do this via the following command, that is the first “cat” part, merging the files, via:


copy /B {file01} {file02} {newfile}

copy /B OVM_EL4U5_X86_PVM_10gR3BIEE.tgz.file1of2 + OVM_EL4U5_X86_PVM_10gR3BIEE.tgz.file2of2 OVM_EL4U5_X86_PVM_10gR3BIEE.tgz
.

the Windows equivalent of the Linux/Unix


cat {file01} {file02}  > {newfile}

cat OVM_EL4U5_X86_PVM_10gR3BIEE.tgz.file1of2 + OVM_EL4U5_X86_PVM_10gR3BIEE.tgz.file2of2 > OVM_EL4U5_X86_PVM_10gR3BIEE.tgz
.

So you the Windows statement will “merge & copy” them into the needed file, in my case file: “OVM_EL4U5_X86_PVM_10gR3BIEE.tgz”.

Now you can, with a (un)zip utility like “winrar”, “untar” the ” “OVM_EL4U5_X86_PVM_10gR3BIEE.tgz” file into its original content.

Marco Gralike Written by:

2 Comments

  1. Geri Reshef
    August 31

    Simple & usefull.
    Thanks

  2. Damir
    January 13

    “copy /b” is much mora appropriate in this context.

    P.S.
    On Win2k8 R2 x64 I do not have cat command!
    Damir Vadas

Comments are closed.