0

我在 .txt 文件中收集了 35k 歌词。它们都在一个文件夹中。有没有办法将它们全部排序在单独的文件夹中(例如按艺术家姓名)

这是一个屏幕截图,它看起来如何。

http://my.jetscreenshot.com/201/20121128-mrwo-76kb

提前致谢

4

1 回答 1

0

你不能没有错误地做到这一点,当你分割文件名时,你认为系统如何知道艺术家或标题名称是什么?

例如 A-HA - 我的歌曲 有 3 个-然后“ A ”成为艺术家,HA-我的歌曲成为歌曲标题。

所以不可能100%准确,需要人工维修。

PS:对不起我的英语。

试试这个:

@Echo OFF

:: By Elektro H@cker


FOR %%@ IN (*) DO (
    Set "Filename=%%@"
    Call :Split "%FILENAME%"
    CMD /C "If not "%%Last_artist%%" EQU "%%artist_name%%" (ECHO Processing: "%%artist_name%%")"
    Call MKDIR "%%artist_name%%" 2>NUL
    Call COPY /Y "%%artist_name%%*" "%%artist_name%%\" >NUL
    Call Set "Last_artist=%%artist_name%%"
)
Pause&exit


:SPLIT
SET "title_name=%FILENAME:*-=%"
CALL SET "artist_name=%%Filename:%title_name%=%%"
CALL SET "artist_name=%%artist_name:~0,-1%%"
IF "%artist_name:~-1%" EQU " " (CALL SET "artist_name=%%artist_name:~0,-1%%")
GOTO:EOF

示例输出:

Processing: "Flyleaf"
Processing: "Flyleaf Vs. The Legion Of Doom"
Processing: "Folk Implosion"
Processing: "Foo Fighters"
Processing: "For All Those Sleeping"
Processing: "Foster The People"
Processing: "Four Year Strong"
Processing: "Franco & Oscarcito"
Processing: "From First To Last"
Processing: "Fuel"
Processing: "Full Blown Rose"
Processing: "Funeral For A Friend"
Processing: "Further Seems Forever"
Processing: "Garbage"
Processing: "Gemini"
Processing: "Georgina"
Processing: "Get Scared"
于 2012-11-28T19:00:24.533 回答