0

I have a lot of files that need renaming.

All of them are named in the following format:

MM DD YYYY filename.txt

These dates are not related to any timestamp in each file. They were given manually when processing them.

I need to change their names to:

YYYY MM DD filename.txt

Do you have any ideas?

I've tried bash and awk scripts, but don't have much experience and all them have failed.

Thanks in advance for anyone who comments here!

Hope everybody is safe and washing their hands.

  • Bash or Zsh? They're different shells – oguz ismail Apr 06 '20 at 19:53
  • Any of them would do. I have them both installed in my system. – Miguel Ángel Pérez Espinosa Apr 06 '20 at 19:58
  • If you don't actually care which tool is used, don't tag for *any* specific tool, just tag for the platform. (The "unix" tag is good for "general UNIX tools are okay"). When you tag for a tool, you should be asking about a specific problem you encountered when using that tool. – Charles Duffy Apr 06 '20 at 20:09
  • ...and if you're asking about a general topic that has a lot of existing Q&A entries (as is the case with this one!), it helps to show how you tried to apply at least one of those existing answers, and a specific problem you encountered when doing so. – Charles Duffy Apr 06 '20 at 20:11
  • If you have zsh, learn to use zmv. It's awesome, like anything zsh: https://filipekiss.com.br/zmv-zsh-rename/ – EdvardM Apr 06 '20 at 21:41

0 Answers0