Linux.com

Home Linux Community Forums Software Command Line bash script to join files

bash script to join files

Link to this post 20 Aug 11

Hi,

I am creating a bash script which search video files in a folder and join video files which are splitted into multiple parts.

for e.g.

shark.cd1.avi
shark.cd2.avi

catroon.cd1.avi
cartoon.cd2.avi
cartoon.cd3.avi


so as to make a single file for e.g. shark.avi and cartoon.avi

Please tell me some tips and suggestions, how to do it. i.e. what way i can find and join the files accordingly ordered by ther cd number.

Thanks

usmangt

Link to this post 21 Aug 11

It seems like you were asking us to do the script... ;)

I could do the script, the only problem is that I do not know how to join the video files... I guess ffmpeg could help in there? I'll try this afternoon

Regards

Link to this post 22 Aug 11

That should be wasy with your experience, setup a bash script which accepts a keyword, then greps the current working directory for all files with that word in the name, orders then using seq and adds their names to the syntax for ffmpeg to join them.

Link to this post 29 Aug 11

Here's two commands you could try working into your script.


mencoder -oac copy -ovc copy part1.avi part2.avi part3.avi -o complete.avi

OR


avimerge -o complete.avi -i part1.avi part2.avi part3.avi

Hope one of these helps you out, :-)

Link to this post 04 Mar 13

Hello Guys I was trying to back-up a the .vob files were all in different information with the same computer file name.I had to rename them sequentially then shift them to another directory. Is there a better way using the console?Any idea then please share!!

Link to this post 05 Mar 13

markspend said:

Hello Guys I was trying to back-up a the .vob files were all in different information with the same computer file name.I had to rename them sequentially then shift them to another directory. Is there a better way using the console?Any idea then please share!!

That makes no sense to me, at all

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board