Renamig File with Underscores

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Casti
Posts: 11
Joined: 22 Mar 2012 10:53

Renamig File with Underscores

#1 Post by Casti » 22 Mar 2012 16:35

I have numerous files with the following structure

REMIT_1902803315_NON_0_20120316_Z120762523_1953760980.835

What I would like to do is rename the files to use the 2nd and 6th token by underscore so the batch file would rename the file to

1902803315_Z120762523.835

I have seen some code to get rid of the first token but I haven't figured out how to get the 2nd and 6th token.

Thanks

Casti

Casti
Posts: 11
Joined: 22 Mar 2012 10:53

Re: Renamig File with Underscores

#2 Post by Casti » 22 Mar 2012 16:58

No need..I searched the board and found a cool batch file of token form ..I think agerman or ifoxfire..The memory is not good here but thanks

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Renamig File with Underscores

#3 Post by Squashman » 22 Mar 2012 17:02

Just a little tweaking of the script in this thread should do the trick for you.
viewtopic.php?f=3&t=3087

Post Reply