Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Wadget

macrumors member
Original poster
Jan 16, 2006
31
0
Hey,

I'm looking for a program that can split and join, more importantly join, files like Split & Concat that will run on OS 9.2

Is there anything like that available?
 
Well there is the Unix split command. That deals with the splitting side. I think you can then just cat >> to append the files back together again.
 
Here is an example (I've just tried it with a real file to confirm it works).

To split the file (in my case called Test.JPG) open the Terminal, cd to the correct folder and type:

Code:
split -b100k Test.JPG

This creates a load of 100k files that are the jpeg split up (the last file is less than 100k.

To put the fragments back together again:

Code:
cat xaa > test1.jpg
cat xab >> test1.jpg
cat xac >> test1.jpg
cat xad >> test1.jpg
...

Repeat all the cats until you run out of files. I suspect there is probably a better way of doing the second step involving some shell scripting. Or you could write a cute GUI for this!

If you want to control the name of the split files a bit better you can do something like:

Code:
split -b100k Test.JPG split_Test_

which will produce files split_Test_aa, split_Test_bb etc.
 
OK. Here's a better way to do the concat stage. If we assume that our input files are called split_test_aa, split_test_bb etc and we want a file called test2.jpg then:

Code:
ls -1 split_test_* | xargs -I fname cat fname >> test2.jpg

will put all the files back together again.

Unix is cool huh?
 
When you say "cd to the correct folder"

How do you cd it to a specific folder?
 
Wadget said:
When you say "cd to the correct folder"

How do you cd it to a specific folder?

When you first start the Terminal your current working directory will be ~ (your home folder /Users/<username> normally). You use cd <foldername> to change to a folder within the current folder. cd .. takes you up one level. You can combine cds together with / so cd Desktop/test would take to you a folder called test on your Desktop if you start in your home folder.

You can list the contents of your current folder via ls. The standard output does not help you tell which are folders. ls -l gives you more details. If the block of letters at the start of the line starts with a d then it's a directory (folder).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.