Rearranging filename with date

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Rearranging filename with date

Postby nwcooper2004 » Sat Mar 19, 2016 1:14 am

I am stuck while trying to rename these filenames

AK-South_Kachemak_Alaska_Subdivis-20160325.csv
AK-Salcha_River-20160325
CA-Orange-20160316
TX-Cameron-20160405

to this format:

03-25-2016 - South Kachemak Alaske Subdivis - County.csv
03-25-2016 - Salcha River - County.csv
03-16-2016 - Orange - County.csv
04-05-2016 - Cameron - County

Much appreciation for any help!
nwcooper2004
 
Posts: 4
Joined: Tue Mar 15, 2016 1:26 am

Re: Rearranging filename with date

Postby Emerkamp » Sat Mar 19, 2016 1:42 am

Hello:

Try This Under Section (1) Regex replace.

Match:
(.*)-(.*)-(\d\d\d\d)(\d\d)(\d\d)

Replace:
\4-\5-\3 - \2 - County


Then Remove the underscores with 2nd step.
This should look just like your example as long as everything is this pattern.
Emerkamp
 
Posts: 140
Joined: Sat Aug 23, 2014 2:35 pm

Re: Rearranging filename with date

Postby nwcooper2004 » Tue Mar 22, 2016 1:09 am

Thanks! Is it also possible to create folders using the first two letters of the filename to name the folder and move the file with those two letters into that folder. for example:
original files
AK-South_Kachemak_Alaska_Subdivis-20160325.csv
AK-Salcha_River-20160325
CA-Orange-20160316
TX-Cameron-20160405

result

03-25-2016 - South Kachemak Alaske Subdivis - County.csv (moved/copied into AK folder)
03-25-2016 - Salcha River - County.csv (moved/copied into AK folder)
03-16-2016 - Orange - County.csv(moved/copied into CA folder)
04-05-2016 - Cameron - County(moved/copied into TX folder)

Thanks again!
nwcooper2004
 
Posts: 4
Joined: Tue Mar 15, 2016 1:26 am

Re: Rearranging filename with date

Postby Emerkamp » Tue Mar 22, 2016 9:09 am

Hello:

I think you can do this in the java section, but you need to learn yourself some java, but not in the basic section.

I think the DEV. plans on adding this option in a next version...
Emerkamp
 
Posts: 140
Joined: Sat Aug 23, 2014 2:35 pm

Re: Rearranging filename with date

Postby Admin » Tue Mar 22, 2016 10:40 am

Yes, it can be done with Javascript if you have a commercial license I can post the script.
Admin
Site Admin
 
Posts: 2344
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support