Page 1 of 1
Help with renaming 3 different files.

Posted:
Wed Nov 06, 2013 10:10 pm
by Don
On a daily basis I need to rename 3 different files. I need to include a date and a specific extension. I have figured out the date part but not the extension. I want to write a commandline that I can schedule for daily processing. Any help is appreciated. When I get the files, they have no extension
Before
sal_adj
sal_act
sal_trd_osi
After
sal_adj_yyyymmdd.saj
sal_act_yyyymmdd.saa
sal_trd_osi_yyyymmdd.sat
Suffixing .extension AFTER Date

Posted:
Thu Nov 07, 2013 1:52 am
by truth
What _DateType is being suffixed?
What logic determines those .extensions?
Do OrigFilenames never have .extensions?
Re: Help with renaming 3 different files.

Posted:
Thu Nov 07, 2013 3:39 pm
by Don
The _DateType is Now.
The command I am using to add the date is
/APPENDDATE:N:s:_::10:%Y%m%d
The files will never have the extensions, I need to add them. The extensions will be bthe same each day. the file sal.adj will get a .saj extension. The file sal_act will get a .saa extionsion and the file sal_trd_osi will get a .sat extension
Thanks for your help.
Suffixing .extension AFTER Date

Posted:
Fri Nov 08, 2013 2:07 am
by truth
OK, filename determines 1 of 3 possible .ext's - no worries
Should these 3-possible .ext's change from 1day to the next?
Do the 3-files reside alone within the same Dir (no other files)?
For now, I'd play it safe with a 3-line batch:
brc32 /pattern:sal_adj /AppendDate:N:s:_::10:%%Y%%m%%d /Suffix:.saj
brc32 /pattern:sal_act /AppendDate:N:s:_::10:%%Y%%m%%d /Suffix:.saa
brc32 /pattern:sal_trd_osi /AppendDate:N:s:_::10:%%Y%%m%%d /Suffix:.sat
Just add /execute, /nofolders, & whatever else you may need (/IgnoreFileX unnecessary)
Re: Help with renaming 3 different files.

Posted:
Fri Nov 08, 2013 6:50 pm
by Don
The file extensions will not change from 1 day to the next and there is 1 other file in the folder. The batch you suggested worked great.
Thanks again.
Re: Help with renaming 3 different files.

Posted:
Sat Nov 16, 2013 11:30 am
by thinMichael
That's helpful to me
