标题: [问题求助] 求个Shell脚本,处理音乐cue的 [打印本页]
作者: netdzb 时间: 2019-7-11 19:55 标题: 求个Shell脚本,处理音乐cue的
本帖最后由 netdzb 于 2019-7-11 20:21 编辑
REM GENRE Country
REM DATE 2006
REM DISCID 6D099C0A
REM COMMENT ExactAudioCopy v1.3
PERFORMER "李慧珍"
TITLE "寻找·李慧珍" --------------------> 这个TITLE不要匹配,要匹配FILE以后的TITLE
FILE "李慧珍 - 寻找·李慧珍.wav" WAVE
TRACK 01 AUDIO
TITLE "欲望敦煌" ------------------>
FLAGS DCP
INDEX 01 00:00:00
TRACK 02 AUDIO
TITLE "寻找李慧珍" -------------------->
FLAGS DCP
INDEX 01 04:24:20
TRACK 03 AUDIO
TITLE "远行" --------------------->
FLAGS DCP
INDEX 01 08:53:14
TRACK 04 AUDIO
TITLE "蓝色魔力" -------------------->
FLAGS DCP
INDEX 01 13:36:64
TRACK 05 AUDIO
TITLE "距离" -------------------->
FLAGS DCP
INDEX 01 17:24:70
TRACK 06 AUDIO
TITLE "自由的味道" --------------------->
FLAGS DCP
INDEX 00 21:18:21
INDEX 01 21:18:44
TRACK 07 AUDIO
TITLE "珍重" --------------------->
FLAGS DCP
INDEX 00 25:00:55
INDEX 01 25:01:03
TRACK 08 AUDIO
TITLE "咖啡时间" ---------------------->
FLAGS DCP
INDEX 01 29:21:21
TRACK 09 AUDIO
TITLE "幸福的眼泪" -----------------------> // 把这些匹配出来,组成一个曲目表
FLAGS DCP
INDEX 01 33:22:64
TRACK 10 AUDIO
TITLE "My Way"
FLAGS DCP
INDEX 01 37:28:24
把上面的变成
01.欲望敦煌
02.寻找李慧珍
03.远行
04.蓝色魔力
.......
作者: Batcher 时间: 2019-7-12 11:13
- awk '/TRACK /,/TITLE /{if($0~/TRACK /)printf("%s.",$2);else{s="";for(i=2;i<=NF;i++)s=s" "$i;gsub(/^ "/,"",s);gsub(/".*/,"",s);printf("%s\n",s)}}' 1.txt
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |