trying to change part of text with sequence for filename
Hello,
I have many files from when I made my tv show collection, but the way I made it is not compatible with the program Im using to get information for it. For example I saved it as: Code:
NameOfShow Episode 01 NameOfEpisode The problem is that I have many shows(MASH) and changing them one by one will take way too long. I could change them easily using Dolphin but then I loose the Name of Episode. How can I change the name while keeping NameOfShow and NameOfEpisode and have it automaticaly count up(1x1,1x2,1x3,etc)? |
This should work for episodes 1 to 9 if run in a bash shell in the directory containing the files
Code:
for file in *; do echo "${file/Episode 0/1x}"; done It is left as an exercise to adjust this for more than 9 episodes. |
Quote:
Im going to try this out over the weekend. Thank you. |
Hello neighbor!
Try doing a forum search. There have been many, many, many previous threads about how to bulk rename files. |
Quote:
The problem with search is that many time I don’t know what to search for. I`ll try to search more in the future. Nice to see another forum member in Osaka. |
@Adol,
Can you share some sample entries of file that containing show/episodes list and sample output that you want? Actually, I had tried it using a script, but without sample data it's not easy to suggest any solution. |
this has to be modified for each season:
Code:
i=01; while [ $i -le 13 ]; do ln -s frisky-dingo-$i-* frisky-dingo.1$i.mkv; i=`expr $i + 1 | awk '{printf "%.2d", $1}'`; done # season 1 scraping |
All times are GMT -5. The time now is 10:39 PM. |