Переямс поля in в directory based off of the text contained within в text file

I am trying to переямс about 20 полей in в directory based off of what в text file contains. I have been searching around and cant really find anything that really ты описываешь the process. Первоначальный All the поля пахал like this:

Track 1.wav
Track 2.wav 

и т.д....

I would like to переямс them to this, which is typed out in в text file, with the ямс I would like for the file line by line.

We are Yours
Awake my Love

и т.д...

Anyone have any ты разрабатываешь on how to do this? I do it снял в бит but I end up doing it manually and it ты существуешь just gotten old.

1
задан 26 December 2015 в 02:04

1 ответ

Как насчет

n=1
while IFS= read -r newname; do
  printf -v oldname 'Track %d.wav' $((n++)) 
  echo mv -vn "$oldname" "$newname"
done < "filenames.txt"

, где filenames.txt название файла, в который Вы ввели желаемые новые имена.

, Если это, кажется, делает правильную вещь тогда, удаляют echo и выполняют его снова для фактического переименования файлов

2
ответ дан 7 December 2019 в 13:50

Другие вопросы по тегам:

Похожие вопросы: