From the command line, I do:
ls /mnt/win_l/sound/sym_35_haffner_wam.ogg /mnt/win_k/ffl/ffl.1110.ogg /mnt/win_l/sound/sym_09_c_fs.ogg /mnt/win_l/sound/sym_36_linz_wam.ogg /mnt/win_k/ffl/ffl.1111.ogg /mnt/data1/sound/E10.Joy.ogg | sh /mnt/win_d/system/rh.ogg3
Here is what I want:
"/mnt/data1/sound/E10.Joy.ogg"... Playback length: 6m:00.129s
"/mnt/win_k/ffl/ffl.1110.ogg"... Playback length: 8m:14.193s
"/mnt/win_k/ffl/ffl.1111.ogg"... Playback length: 26m:44.046s
"/mnt/win_l/sound/sym_09_c_fs.ogg"... Playback length: 47m:47.478s
"/mnt/win_l/sound/sym_35_haffner_wam.ogg"... Playback length: 22m:20.395s
"/mnt/win_l/sound/sym_36_linz_wam.ogg"... Playback length: 29m:33.627s
Total 138 minutes
Here is what I get:
"/mnt/data1/sound/E10.Joy.ogg"... Playback length: 6m:00.129s
Total 6 minutes
"/mnt/win_k/ffl/ffl.1110.ogg"... Playback length: 8m:14.193s
Total 8 minutes
"/mnt/win_k/ffl/ffl.1111.ogg"... Playback length: 26m:44.046s
Total 26 minutes
"/mnt/win_l/sound/sym_09_c_fs.ogg"... Playback length: 47m:47.478s
Total 47 minutes
"/mnt/win_l/sound/sym_35_haffner_wam.ogg"... Playback length: 22m:20.395s
Total 22 minutes
"/mnt/win_l/sound/sym_36_linz_wam.ogg"... Playback length: 29m:33.627s
Total 29 minutes
The above is generated by:
#!/bin/bash
while read data; do
ogginfo $data | \
gawk ' BEGIN { RS = "Processing file" ; FS = "\n" }
{ print $1 " " $15 }
{ split ($15,a,/m:/)
sum +=substr(a[1],18,3 )+0 }
END {
print "Total "sum" minutes"
} '
I simply want to parse and sum the minutes only from field 15.
It seems the END statement is not working properly.
What am I doing wrong?
Thank you for your help.
Richard
ls /mnt/win_l/sound/sym_35_haffner_wam.ogg /mnt/win_k/ffl/ffl.1110.ogg /mnt/win_l/sound/sym_09_c_fs.ogg /mnt/win_l/sound/sym_36_linz_wam.ogg /mnt/win_k/ffl/ffl.1111.ogg /mnt/data1/sound/E10.Joy.ogg | sh /mnt/win_d/system/rh.ogg3
Here is what I want:
"/mnt/data1/sound/E10.Joy.ogg"... Playback length: 6m:00.129s
"/mnt/win_k/ffl/ffl.1110.ogg"... Playback length: 8m:14.193s
"/mnt/win_k/ffl/ffl.1111.ogg"... Playback length: 26m:44.046s
"/mnt/win_l/sound/sym_09_c_fs.ogg"... Playback length: 47m:47.478s
"/mnt/win_l/sound/sym_35_haffner_wam.ogg"... Playback length: 22m:20.395s
"/mnt/win_l/sound/sym_36_linz_wam.ogg"... Playback length: 29m:33.627s
Total 138 minutes
Here is what I get:
"/mnt/data1/sound/E10.Joy.ogg"... Playback length: 6m:00.129s
Total 6 minutes
"/mnt/win_k/ffl/ffl.1110.ogg"... Playback length: 8m:14.193s
Total 8 minutes
"/mnt/win_k/ffl/ffl.1111.ogg"... Playback length: 26m:44.046s
Total 26 minutes
"/mnt/win_l/sound/sym_09_c_fs.ogg"... Playback length: 47m:47.478s
Total 47 minutes
"/mnt/win_l/sound/sym_35_haffner_wam.ogg"... Playback length: 22m:20.395s
Total 22 minutes
"/mnt/win_l/sound/sym_36_linz_wam.ogg"... Playback length: 29m:33.627s
Total 29 minutes
The above is generated by:
#!/bin/bash
while read data; do
ogginfo $data | \
gawk ' BEGIN { RS = "Processing file" ; FS = "\n" }
{ print $1 " " $15 }
{ split ($15,a,/m:/)
sum +=substr(a[1],18,3 )+0 }
END {
print "Total "sum" minutes"
} '
I simply want to parse and sum the minutes only from field 15.
It seems the END statement is not working properly.
What am I doing wrong?
Thank you for your help.
Richard