LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 06-03-2019, 11:05 PM   #1
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Rep: Reputation: 19
I need help creating a script for Windows batch file.


I am looking to create a windows batch script. I know that this is a Linux forum, but I thought that someone here might be able to help out with this. I am willing to pay a small amount. I don't think this is a huge job, but it would save me a ton of time if I can get someone to do it for me.

Here is what I need:
Code:
I have a hierarchy of client folders and files that over the years has become inconsistent.  In addition, I am now going fully paperless so I need to add more search ability into the file names.  My current structure is as follows:

Parent Folder:  Accounts
> indicates a sub-folder
** Files listed under each subfolder
Accounts > John - TYPE - 101010101CR
23-Apr-2019 - D.pdf
23-Sep-2019 - W.pdf
25-Sept-2019 - F.xlsx

Accounts > John - TYPE2 - 123123123CR
15-Jul-2018 - F.docx
23-July-2017 - R.pdf
3-Mar-2015 - C.pdf
2018-06-30 - R.xlsx
2018-06-23 - R.docx

Accounts > Mary - TYPE - 20202020CR
4-March-2015 - R.pdf
17-Dec-2018 - W.pdf
2019-05-18 - F.xlsx

** NOTE **  You will notice that sometimes the date is different.  Sometimes it is all numbers, sometimes it has the word for the month and sometimes it only has 3 letters for the month.  (This is the inconsistency from different assistants that I've had).

I don't want to create a batch that will go through ALL clients because I want to have some quality control to make sure errors don't happen.

I would like to create a script that will do the following:

1.  It needs to go into each subfolder that is there and it needs to reformat all of the dates so that it looks like this:
YYYY-MM-DD

So, it will need to be able to analyze the different formats that I gave you and extract the correct information to give you the info that you need able for the date above.

2. Each MAIN subfolder it is in, needs to be saved and inserted into the file names.  For example:

CURRENTLY:
Accounts > John - TYPE - 123412343CR > 2019-March-3 - D.pdf

Needs to be changed to:
Accounts > John - TYPE - 123412343CR > 2019-03-03 - John - TYPE - 123412343CR - D.pdf

Now... Inside John - TYPE - 123412343CR  there are subfolders called 2019 BlahBlah or 2018 BlahBlah or 2017 BlahBlah (and so on).  Those subfolder files will need the same format as above.  

For example:
Accounts > John - TYPE - 123412343CR > 2015 Forms > 23-December-03 - D.pdf

Needs to be changed to:
Accounts > John - TYPE - 123412343CR > 2003 Forms > 2003-12-23 - John - TYPE - 123412343CR - D.pdf

NOTE:  The subfolder 2015 Forms does not get inserted into the file name, but the overall parent folder "John - TYPE - 123412343CR" does.

3.  There needs to be output for everything and human input for every change.  Something like:

Working Folder:  Smith, John & Mary
Current Subfolder:  John - TYPE - 123412344CR

Change:  23-March-15 - D.pdf
To: 2015-03-23 - John - TYPE - 123412344CR - D.pdf
Make the change [Y] or N?
Is anyone here interested in this for a nominal fee? If not, can anyone point me in the right direction please?

Last edited by jim.thornton; 06-03-2019 at 11:06 PM.
 
Old 06-04-2019, 01:40 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
The forum rules do not permit advertising. Please visit http://www.linuxquestions.org/advertising/ for more information on advertising. Feel free to contact the forum admin if you have any questions about this policy.

You can post your requirements to the LQ Jobs Marketplace.

While the Programming forum is open to questions targeting other operating systems, the questions must still rise to the general standard of well formed specific questions described in the Site FAQ and LQ Rules. Yours does not so this thread is being closed.

Please open a new thread or two to ask for help with the specific programming problems needed by your application!

Good luck!

Last edited by astrogeek; 06-04-2019 at 11:20 AM. Reason: better phrasing, jobs marketplace
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help creating a batch renaming script. aerospades Linux - Newbie 13 10-29-2014 07:53 AM
Creating a batch of new users and adding ssh keys using a script mattjjs Linux - Newbie 5 02-13-2014 10:46 AM
[SOLVED] how to write a batch file in linux?and what are batch(.bat) file benefits? karthilin Linux - Newbie 8 10-15-2012 02:10 PM
Need to convert a batch file to a shell script webshore Linux - Newbie 2 05-03-2010 07:42 AM
Need help writing a batch/script file cbjhawks Linux - General 1 01-28-2004 05:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration