Monday 15 September 2014

automator - Rename every other file -


I have a few files that I would like to name (many to do it manually), usually I Automator but the thing is that I need another file, which must be said before the file, but instead of 2 1

this is my File is by now

  xxx - 401a - yyy.zzz xxx - 401b - yyy.zzz xxx - 402a - yyy.zzz xxx - 402b - yyy.zzz xxx - 403a - yyy. Zzz   

and similarly, but I would like to change their name for something like

  xxx - 401-pt1.zzz xxx - 401-pt2 . Zzz xxx - 402-pt1.zzz xxx - 402-pt2.zzz xxx - 403-pt1.zzz   

Anyway to do this with Automator? Ask because I'm actually using the automator really, which means that I'm not really that you tell a specialist.

Edit: This is what I am trying to achieve:

< P> If you do not know anything about that device, will not you mind using anything else? How about ordinary shell commands?

Here's the way to increase the level of genericity in Bash. You probably do not care about the first two because it has hardcoded yyy and zzz, but I did it to show you a little to understand the third.

  in the file *; Do mv "$ file" "$ (echo $ file | sed 's / a - yyy / -pt1 / g')"; MV "$ file" "$ (resonance file | sad / b - yyy / -pt2 / g ')"; File * for; Do mv "$ file" "$ (echo $ file | sed 's / a - * .zzz / -pt1.zzz / g')"; MV "$ file" "$ (echo $ file | sed 's / b - * .zzz / -pt2.zzz / g')"; File * for; Do mv "$ file" "$ (echo $ file | sed -r 's / a -. *. ([A-z] {3}) / - pt1. \ 1 /')"; Mv "$ file" "$ (echo $ file | sed -r 's / b - *. ([A-z] {3}) / - pt2. \ 1 /')"; Done   

There should be several other methods of course with other commands. You will get unimportant errors because the MV happens twice on the whole batch.

No comments:

Post a Comment