[opensuse] A real problem: splitting files
Hi all ! I came across a problem: splitting files. How to best approach this problem ? I have used "split" command: Like that, to split 1 ISO file into many 1 MB files. split -d -b $[1000*1000] --verbose ../visopsys-0.62.iso But I came across a problem, how-to merge them back? I did something *very* ugly: alexey@opensuse102:/F/OSes/test> cp x00 finalfile.iso alexey@opensuse102:/F/OSes/test> cat x01 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x02 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x03 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x04 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x05 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x06 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x07 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x08 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x09 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x10 >> finalfile.iso alexey@opensuse102:/F/OSes/test> alexey@opensuse102:/F/OSes/test> md5sum ../visopsys-0.62.iso f76eea3e3bbb441570984a7f6fb8d646 ../visopsys-0.62.iso alexey@opensuse102:/F/OSes/test> md5sum finalfile.iso f76eea3e3bbb441570984a7f6fb8d646 finalfile.iso Is there any beautyful command, that is "anti-split" ? I have tried "join", but this command is very bad: it can only join up to 2 files. I have heard about the possibility of multi-volume TAR archives, but I could not find the right keys in the tar info pages. Please help me finding the convenient commands to split/join files -- -Alexey Eremenko "Technologov" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
cat f1 f2 f3 f4 f5 f6 f7 f8 > bigfile ?? ==John ffitch -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 29 July 2007 20:16:31 Alexey Eremenko wrote:
Hi all !
I came across a problem: splitting files.
How to best approach this problem ?
I have used "split" command: Like that, to split 1 ISO file into many 1 MB files. split -d -b $[1000*1000] --verbose ../visopsys-0.62.iso
But I came across a problem, how-to merge them back?
I did something *very* ugly: alexey@opensuse102:/F/OSes/test> cp x00 finalfile.iso alexey@opensuse102:/F/OSes/test> cat x01 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x02 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x03 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x04 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x05 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x06 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x07 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x08 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x09 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x10 >> finalfile.iso alexey@opensuse102:/F/OSes/test> alexey@opensuse102:/F/OSes/test> md5sum ../visopsys-0.62.iso f76eea3e3bbb441570984a7f6fb8d646 ../visopsys-0.62.iso alexey@opensuse102:/F/OSes/test> md5sum finalfile.iso f76eea3e3bbb441570984a7f6fb8d646 finalfile.iso
Is there any beautyful command, that is "anti-split" ?
cat x* > foo.iso works when the number of files is small enough so it fits on a command line. Otherwise you'd have to do it in steps, or perhaps write a small script to do it -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 29 July 2007 12:01, Alexey Eremenko wrote:
Thanks all of you !
cat x* > foo.iso
This one is especially cool command :) so especially thanks !
Yes, very fancy...
-- -Alexey Eremenko "Technologov"
RRS -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Alexey Eremenko wrote:
Thanks all of you !
cat x* > foo.iso
This one is especially cool command :) so especially thanks !
There are a *LOT* of "cool" bash commands. Read any book on bash scripts to find them. Other shells have similar capabilities, but bash seems to be the most popular. Bash also has a cool acronym for a name. Since Bash is an improvement on the earlier Bourne shell, it was called "Bourne again shell". ;-) -- Use OpenOffice.org <http://www.openoffice.org> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 29 July 2007 12:46, James Knott wrote:
Alexey Eremenko wrote:
Thanks all of you !
cat x* > foo.iso
This one is especially cool command :) so especially thanks !
There are a *LOT* of "cool" bash commands. Read any book on bash scripts to find them. Other shells have similar capabilities, but bash seems to be the most popular. Bash also has a cool acronym for a name. Since Bash is an improvement on the earlier Bourne shell, it was called "Bourne again shell". ;-)
Of course, "cat" is a command implemented as a binary file, not a shell built-in, so it is equally accessible in all shells (as well as to any scripting system with native command execution such as Perl). Also, the very simple glob (file name wildcard) used in this example is shared by all shells.
-- Use OpenOffice.org <http://www.openoffice.org>
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 30 July 2007 01:16, Alexey Eremenko wrote:
AE Hi all ! AE AE I came across a problem: splitting files. AE AE How to best approach this problem ? AE AE I have used "split" command: AE Like that, to split 1 ISO file into many 1 MB files. AE split -d -b $[1000*1000] --verbose ../visopsys-0.62.iso AE AE But I came across a problem, how-to merge them back? AE AE I did something *very* ugly: AE alexey@opensuse102:/F/OSes/test> cp x00 finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x01 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x02 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x03 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x04 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x05 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x06 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x07 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x08 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x09 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> cat x10 >> finalfile.iso AE alexey@opensuse102:/F/OSes/test> AE alexey@opensuse102:/F/OSes/test> md5sum ../visopsys-0.62.iso AE f76eea3e3bbb441570984a7f6fb8d646 ../visopsys-0.62.iso AE alexey@opensuse102:/F/OSes/test> md5sum finalfile.iso AE f76eea3e3bbb441570984a7f6fb8d646 finalfile.iso AE AE Is there any beautyful command, that is "anti-split" ? AE I have tried "join", but this command is very bad: it can only join up AE to 2 files. AE AE I have heard about the possibility of multi-volume TAR archives, but I AE could not find the right keys in the tar info pages. AE AE Please help me finding the convenient commands to split/join files AE AE -- AE -Alexey Eremenko "Technologov"
You may try to join them in this way: 1) Put all parts in one place (for example ~/tmp/finalfile) 2) Make sure that there are no other files in this directory 3) Join files. It works, because `split` gives names to files with alphabetical order. find ~/tmp/finalfile | while read file; do cat $file >> finalfile.iso; done; 4) Check md5 sums 5) Now you may delete x* files in ~/tmp/finalfile directory -- WBR, Dmitry. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Alexey Eremenko wrote:
Hi all !
I came across a problem: splitting files.
How to best approach this problem ?
I have used "split" command: Like that, to split 1 ISO file into many 1 MB files. split -d -b $[1000*1000] --verbose ../visopsys-0.62.iso
But I came across a problem, how-to merge them back?
I did something *very* ugly: alexey@opensuse102:/F/OSes/test> cp x00 finalfile.iso alexey@opensuse102:/F/OSes/test> cat x01 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x02 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x03 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x04 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x05 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x06 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x07 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x08 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x09 >> finalfile.iso alexey@opensuse102:/F/OSes/test> cat x10 >> finalfile.iso alexey@opensuse102:/F/OSes/test> alexey@opensuse102:/F/OSes/test> md5sum ../visopsys-0.62.iso f76eea3e3bbb441570984a7f6fb8d646 ../visopsys-0.62.iso alexey@opensuse102:/F/OSes/test> md5sum finalfile.iso f76eea3e3bbb441570984a7f6fb8d646 finalfile.iso
Is there any beautyful command, that is "anti-split" ? I have tried "join", but this command is very bad: it can only join up to 2 files.
I have heard about the possibility of multi-volume TAR archives, but I could not find the right keys in the tar info pages.
Please help me finding the convenient commands to split/join files
One thing you could have tried is cat x00 x01 x02...x10 > finalfile.iso. Perhaps using a wild card would work: cat x?? > finalfile.iso or cat x*
finalfile.iso
-- Use OpenOffice.org <http://www.openoffice.org> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (6)
-
Alexey Eremenko
-
Anders Johansson
-
Dmitry
-
James Knott
-
jpff
-
Randall R Schulz