Subject: Re: [Name Mangler Talk] renaming back to the original file name

From: Rob Griffiths <[email-masked]>
Date: Wed, 27 Jun 2012 15:56:14 -0600

On Jun 27, 2012, at 8:40 AM, skim1680 wrote:

> correct.

Enter the following into the Advanced mode in Name Mangler, but read this first...

***************************************************
**                                               **
**                 WARNING!!!!!!                 **
**                                               **
***************************************************

PLEASE TEST THIS ON A COPY OF YOUR FILES!

As you can see, the code is very complex, and it was based on only the single sample filename we were given. There is a very good chance this may not work exactly as you expect. Because there is no undo, **please duplicate your files first before testing!**

With that said, here's the code:

----------------

[if
	[findRegularExpression
		"^[\D_]+(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$"
		in <name>
		replace with ""
	]
then
	<name.extension>
else
	[concatenate
		[findRegularExpression
			"^[\D_]+(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$"
			in <name>
			replace with "dm_jamdirect_$3"
		],
		[findRegularExpression
			[concatenate
				".*",
				[findRegularExpression
					"^[\D_]+(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$"
					in <name>
					replace with "$2"
				],
				"(\D{3}).*"
			]
			in "01jan 02feb 03mar 04apr 05may 06jun 07jul 08aug 09sep 10oct 11nov 12dec"
			replace with "$1"
		],
		[findRegularExpression
			"^[\D_]+(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$"
			in <name>
			replace with [concatenate
				"$1_14.32.03",
				<.extension>,
				"_$1$2$3$4$5$6._tml"
			]
		]
	]
]

-----------------

Please let us know how this works for you.

regards,
-rob.

---

From: skim1680 <[email-masked]>
Date: Wed, 27 Jun 2012 07:40:47 -0700 (PDT)

correct.  

On Tuesday, June 26, 2012 11:20:30 AM UTC-4, Many Tricks wrote:
>
> On Jun 26, 2012, at 7:49 AM, skim1680 wrote: 
>
> > MYZ_P_IMS_20120613152220.txt  (numbers are yyyymmddhhmmss) 
> > 
> > and needs to be renamed to 
> > 
> > dm_jamdirect_13jun2012_14.32.03.txt_20120613152220._tml 
>
> Just to confirm, every original filename starts with... 
>
> MYZ_P_IMS_ 
>
> ...and every renamed file will start... 
>
> dm_jamdirect_ 
>
> ...and have ".txt_" inserted in the middle, followed by the original 
> identifying sequence, and finally, end in "._tml" 
>
> Is that right? 
>
> regards, 
> -rob.

---

From: Rob Griffiths <[email-masked]>
Date: Tue, 26 Jun 2012 09:20:30 -0600

MYZ_P_IMS_

dm_jamdirect_

...and have ".txt_" inserted in the middle, followed by the original identifying sequence, and finally, end in "._tml"

Is that right?

regards,
-rob.

---

From: skim1680 <[email-masked]>
Date: Tue, 26 Jun 2012 06:49:06 -0700 (PDT)

We have a multiple number of files that need to be renamed the format
is as follows.

to accommodate an automated process.

I tried using if statements to read the different months but can't
figure out how to break out the date/time stamps aswell.

Can someone assist?

thx

SKIM