注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Oh! I see you!

Hi! ppmm~~

 
 
 

日志

 
 

批处理批量替换cue文件里的歌曲title  

2010-01-05 22:07:25|  分类: Batch |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

本文链接:http://oicu.cc.blog.163.com/blog/static/12303947120100510725243/

好久没用bat了,有点生疏,还好这点小问题对我来说还是小case的,先写解法后面附上问题。

@echo off
::Code by oicu#lsxk.org 2010-01-05, for
cmd@Windows

type nul>c.txt
SETLOCAL ENABLEDELAYEDEXPANSION
FOR /F "delims=" %%a in (b.txt) do (
    echo.%%a | findstr /i "Track[0-9]" >NUL && (
        set swap=%%a
        set swap=!swap:Track=!
        rem echo !swap!
        FOR /F "tokens=1,2* delims=." %%i in ('type a.txt^| findstr /i "!swap!"') do (
            echo.    TITLE "%%j">>c.txt
        )
    ) || (
        echo.%%a>>c.txt
    )
)
ENDLOCAL
goto :eof



发信人: coreqq (风起云涌), 信区: DOS
标  题: Re: 问个复杂点的批处理
发信站: 水木社区 (Tue Jan  5 19:28:16 2010), 站内

嗯,我列真实文件吧,有点长,目的就是修改无损音乐的cue文件内容

a中含有如“01.字符串1”“02.字符串2”之类条目(一条一行)
b中有"title01""title02"之类条目(一条一行)
现在需要把b中的“title01”用a中的“字符串1”替换,“title02”用“字符串2”换

---------------------------a.txt----------------------------
专辑中文名:《璇曲蔓地(一)XRCD》
出品:柏菲唱片
歌手: 古璇
资源格式: WAV+CUE

简介:
我国流传下来不少好歌曲,《璇曲蔓地 Melody All Over the Land》就是一张纪录了这样自然的,纯朴的歌曲。自然的选材,一把好嗓子的演绎,令人沉醉。《长亭外》《怀念战友》《渔光曲》《长城谣》等等,不老的旋律,炙热的音符。不用发烧来形容这张CD,因为我不知道什么是发烧碟。我只说这张CD很不错,录音质量也令人点头满意,同时也是一张不错的人声欣赏碟。
专辑曲目:
01.长亭外
Outside The Pavilion
02.怀念战友 电影《冰山上的来客》插曲
In Memory For Comrade In Arms
03.秋水伊人 电影《古塔奇案》插曲
She Stands In The Riverbank In Autumn
04.曲蔓地 新疆民歌
Melody All Over The Land
05.歌唱二小放牛郎
Singing For The Cowboy
06.鼓浪屿之波
Waves On Gulangyu Island
07.革命人永远是年轻 歌剧《星星之火》选曲
Revolution Is Forever Young
08.草原上升起不落的太阳
Everlasting Sun Rising On The Grassland
09.渔光曲 电影《渔光曲》插曲 (推荐曲目)
Music On Fishing Lights
10.长城谣 (推荐曲目)
The Great Wall Ballad
11.春天里 电影《十字街头》插曲
In Spring Time
12.可爱的一朵玫瑰花
A lovely Rose
13.翻身农奴把歌唱 纪录影片《今日西藏》主题歌
Helots Singing For Liberty

14.难忘今宵
-------------------------a.txt----------------------------
------------------------b.txt-----------------------------
PERFORMER "古璇-《璇曲蔓地(一)XRCD》"
TITLE "古璇-《璇曲蔓地(一)XRCD》"
FILE "璇曲蔓地(一)XRCD.wav" WAVE
  TRACK 01 AUDIO
    TITLE "Track01"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 01 00:00:00

  TRACK 02 AUDIO
    TITLE "Track02"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 03:33:24
    INDEX 01 03:36:25
  TRACK 03 AUDIO
    TITLE "Track03"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 08:19:67
    INDEX 01 08:25:12
  TRACK 04 AUDIO
    TITLE "Track04"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 13:35:39
    INDEX 01 13:39:25
  TRACK 05 AUDIO
    TITLE "Track05"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 17:14:33
    INDEX 01 17:18:00
  TRACK 06 AUDIO
    TITLE "Track06"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 22:33:05
    INDEX 01 22:36:12
  TRACK 07 AUDIO
    TITLE "Track07"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 26:52:47
    INDEX 01 26:57:00
  TRACK 08 AUDIO
    TITLE "Track08"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 30:37:06
    INDEX 01 30:40:12
  TRACK 09 AUDIO
    TITLE "Track09"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 34:54:04
    INDEX 01 34:58:25
  TRACK 10 AUDIO
    TITLE "Track10"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 40:41:51
    INDEX 01 40:44:62
  TRACK 11 AUDIO
    TITLE "Track11"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 44:19:69
    INDEX 01 44:24:62
  TRACK 12 AUDIO
    TITLE "Track12"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 49:20:24
    INDEX 01 49:23:37
  TRACK 13 AUDIO
    TITLE "Track13"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 53:53:22
    INDEX 01 53:56:25
  TRACK 14 AUDIO
    TITLE "Track14"
    PERFORMER "古璇"
    REM WWWUSER
    REM UNSYNCEDLYRICS
    REM PUBLISHER
    REM PERFORMER
    REM ORIGARTIST
    REM GENRE
    REM ENCODEDBY
    REM COPYRIGHT
    REM COMPOSER
    REM COMMENT
    INDEX 00 58:07:20
    INDEX 01 58:10:62
----------------------b.txt------------------

  评论这张
 
阅读(1383)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017