Jump to content

Having an extremely hard time making my organizer script!


 Share

Recommended Posts

Okay, I'll try to explain this best i can.

Scenario

So let's say i have 500 different folders. Each folder contains various files and 1 TXT file.

Within the TxT file it would read (For example) "From : John Smith"

Please Note : There are Repeats for some of these folders, I.E John Smith's name might be in 5 or 10 of the 500 folders

Script

Here's what i want my script to do:

-Go into every folder and open the singular TxT file

-'Read' the Txt file (ONLY the part that comes after "From:", so as to only capture the name of the person)

-Take the name that it parsed, and Create a NEW folder in some other directory WITH THAT NAME (C:\Cards\John Smith\)

-Copy the folder (the one that includes the TxT file and various files) into the new one it just created (C:\Cards\John Smith\)

-Rinse and repeat For all of the original 500 folders

Special Note

-If it comes to be that John Smith Comes up a SECOND time, it obviously wouldn't be able to create the folder as it already exists, therefore it would skip the folder creation part and move the files to the created folder.

I hope i did a good job explaining it. I've been racking my brains on this one and i simply can't get started! I know there are some very talented people here so i come to you for help.

Thanks guys.

Link to comment
Share on other sites

Here's what i want my script to do:

-Go into every folder...

_FileListToArray() and a For/Next loop.

...and open the singular TxT file

-'Read' the Txt file (ONLY the part that comes after "From:", so as to only capture the name of the person)

FileRead() and StringRegExp() or other string manipulation.

-Take the name that it parsed, and Create a NEW folder in some other directory WITH THAT NAME (C:\Cards\John Smith\)

-Copy the folder (the one that includes the TxT file and various files) into the new one it just created (C:\Cards\John Smith\)

DirCopy().

-Rinse and repeat For all of the original 500 folders

Already covered by the For/Next loop.

Special Note

-If it comes to be that John Smith Comes up a SECOND time, it obviously wouldn't be able to create the folder as it already exists, therefore it would skip the folder creation part and move the files to the created folder.

Make DirCopy() conditional on "If Not FileExists($DestinationDir) Then".

I hope i did a good job explaining it. I've been racking my brains on this one and i simply can't get started! I know there are some very talented people here so i come to you for help.

Thanks guys.

Look those functions up in the help file. Check out the example scripts for each in the help file. Start coding your script. If you get stuck post some more specific questions.

Merry Christmas!

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...