Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > how to join files in terminal

how to join files in terminal
Thread Tools
weric
Junior Member
Join Date: Dec 1999
Location: Loveland, CO, USA
Status: Offline
Reply With Quote
Oct 25, 2002, 05:37 PM
 
how do i join files (types mp3 and mpg) in the terminal? i tried:

cat 1.mpg 2.mpg > 3.mpg

the result was a file that was the right size, but would only play the contents of the first file (1.mpg).

i know there are a coouple shareware programs like rosetta that claim to join files, but i'd rather do it in the terminal.

any advice?

/eric
     
VEGAN
Senior User
Join Date: Jun 2002
Location: UK
Status: Offline
Reply With Quote
Oct 25, 2002, 06:58 PM
 
`mpgtx' should have joining option... but use it with caution, as far as I know it's just a beta...
     
fat mac moron
Grizzled Veteran
Join Date: Sep 2002
Status: Offline
Reply With Quote
Oct 25, 2002, 09:34 PM
 
Originally posted by weric:
how do i join files (types mp3 and mpg) in the terminal? i tried:

cat 1.mpg 2.mpg > 3.mpg

the result was a file that was the right size, but would only play the contents of the first file (1.mpg).

i know there are a coouple shareware programs like rosetta that claim to join files, but i'd rather do it in the terminal.

any advice?

/eric
cat my-file.mpg.000 >> my-new.mpg
cat my-file.mpg.001 >> my-new.mpg

Or, using your example:

cat 1.mpg >> new.mpg
cat 2.mpg >> new.mpg

Make sure you use '>>' and not >
     
qyn
Dedicated MacNNer
Join Date: Dec 2000
Location: sj ca
Status: Offline
Reply With Quote
Oct 25, 2002, 09:42 PM
 
Originally posted by weric:

cat 1.mpg 2.mpg > 3.mpg
This sounds like a fishy operation to me anyway. Don't mp3's have header information? If they do, then you've got the 1.mpg header on a file that's just a lot bigger (implying that the 2.mpg information will be ignored). Thus you'd need a "smart" cat operation that can actually write the new header correctly.

But I'm no expert on mp3s...
     
VEGAN
Senior User
Join Date: Jun 2002
Location: UK
Status: Offline
Reply With Quote
Oct 26, 2002, 12:59 PM
 
Originally posted by qyn:


This sounds like a fishy operation to me anyway. Don't mp3's have header information? If they do, then you've got the 1.mpg header on a file that's just a lot bigger (implying that the 2.mpg information will be ignored). Thus you'd need a "smart" cat operation that can actually write the new header correctly.

But I'm no expert on mp3s...
It is "fishy" and that's why I told to use `mpgtx' that takes care of the header information... or should... I haven't been following the latest CVSs
     
weric  (op)
Junior Member
Join Date: Dec 1999
Location: Loveland, CO, USA
Status: Offline
Reply With Quote
Oct 27, 2002, 05:34 PM
 
i installed mpgtx 1.3 and it works perfectly. thanks for the help.

/eric
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 05:15 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,