Re: [LAU] Discovering file format

From: Ralf Mardorf <ralf.mardorf@email-addr-hidden-dsl.net>
Date: Sun Sep 20 2015 - 01:04:38 EEST

On Sat, 19 Sep 2015 22:12:36 +0100, Will J Godfrey wrote:
>As it was only uncompressed files I was looking at 'file' turned out
>to be the simplest and fastest. I simply redirected the output to
>create a text file, then picked it up with kwrite. As each entry was
>on a single line I bulk replaced the unwanted bits with nothing and
>ended up with a list like this:
>
>The_Long_Years 24 bit, 44100 Hz
>The_Man_With_The_Hat 16 bit, 44100 Hz
>The_Mystic 16 bit, 44100 Hz
>The_Piper 16 bit, 44100 Hz
>The_Storm 24 bit, 48000 Hz
>...
>Who_Cares 16 bit, 44100 Hz
>Widow 16 bit, 44100 Hz
>Wimpole 16 bit, 48000 Hz
>Wires 16 bit, 44100 Hz
>Yoshimi_Rides_Home 16 bit, 48000 Hz

You don't need to do it manually, you could use command line to format
the list.

$ printf "%-35s\t\t%s %s\t%s\n" $(file *wav|grep -v link|awk '{print $1" "$9" "$10" "$12}') >~/formated_wav_list.txt

$ cat ~/formated_wav_list.txt
robo´s_harp-raw_a-1.wav: 16 bit, 44100
robo´s_harp_raw_a_off-key.wav: 16 bit, 44100
robo´s_harp_raw_f#_at.wav: 16 bit, 44100
robo´s_harp-raw´n´syn_a-1.wav: 16 bit, 44100
robo´s_harp_raw´n´syn_a_off-key.wav: 16 bit, 44100
robo´s_harp_raw´n´syn_f#_at.wav: 16 bit, 44100
robo´s_harp-syn_a-1.wav: 16 bit, 44100
robo´s_harp_syn_a_off-key.wav: 16 bit, 44100
robo´s_harp_syn_f#_at.wav: 16 bit, 44100

$ sed -i s/":"/" "/g ~/formated_wav_list.txt

$ cat ~/formated_wav_list.txt
robo´s_harp-raw_a-1.wav 16 bit, 44100
robo´s_harp_raw_a_off-key.wav 16 bit, 44100
robo´s_harp_raw_f#_at.wav 16 bit, 44100
robo´s_harp-raw´n´syn_a-1.wav 16 bit, 44100
robo´s_harp_raw´n´syn_a_off-key.wav 16 bit, 44100
robo´s_harp_raw´n´syn_f#_at.wav 16 bit, 44100
robo´s_harp-syn_a-1.wav 16 bit, 44100
robo´s_harp_syn_a_off-key.wav 16 bit, 44100
robo´s_harp_syn_f#_at.wav 16 bit, 44100

Regards,
Ralf
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Sun Sep 20 04:15:01 2015

This archive was generated by hypermail 2.1.8 : Sun Sep 20 2015 - 04:15:01 EEST