Without knowing details, here's a quick & dirty method:
ls | cut -d '_' -f 1 | sort | uniq | xargs -i sox [args here] {}_ru {}_af
{}_output
This makes a few assumptions:
- None of the files have an underscore besides the delimiter before the
suffix.
- All of the files in your directory are *_{ru|af}.
- All *_ru files have a complementary *_af file
- You know what args to pass to sox (because I don't).
On Mon, Jun 6, 2011 at 5:46 AM, mopman <[email protected]> wrote:
> Ubuntu 10.10 64 bit
> BASH shell
>
>
> I'm trying to concatenate a list of audio files.
>
> The files all look as follows:
>
> file1_af
> file1_ru
> file2_af
> file2_ru
>
> In all cases I need to add the "_ru" file to the end of the "_af"
> file. What I need is a script that would match all prefixes in the
> directory and then concatenate them (_ru has to be after _af in all
> cases). It seems that sox will be the best program to use to combine
> the audio files, but I cannot for the life of me write a proper script
> to match the files.
>
> I thought of using regular expressions, but I think I will probably
> be adding to my misery if I do that.
>
> Any help would be appreciated, even if you just point me in the right
> direction.
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Linux Users
> Group.
> To post a message, send email to [email protected]
> To unsubscribe, send email to [email protected]
> For more options, visit our group at
> http://groups.google.com/group/linuxusersgroup
> Please remember to abide by our list rules (http://tinyurl.com/LUG-Rulesor
> http://cdn.fsdev.net/List-Rules.pdf)
>
--
Daniel
--
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at
http://groups.google.com/group/linuxusersgroup
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules or
http://cdn.fsdev.net/List-Rules.pdf)