Jump to content
Sign in to follow this  
davidfin

copy .png's to folders

Recommended Posts

davidfin

Im new to autoit and just wondering is it possible to get autoit to compare the names of .png files in one folder with names in column 1 of a csv file and move them into other folders via data in column 2.

Example:

"personsname.png" is in folder called "c:\allpics" all 900+ of them

I have a csv file with 2 columns populated, column 1 is the same name as the personsname.png and column 2 is the folder i want them moved to e.g. 8x,8y.8z.

So the script would run compare the name of the .png to column 1 and move it to the corresponding folder name of cloumn 2.

hope you can help.

Share this post


Link to post
Share on other sites
Melba23

davidfin,

Welcome to the AutoIt forum. ;)

AutoIt can do what you want very simply. You will need to get the data from the csv file into an array (_FileReadToArray will do this) and then get the png files into another array (here you would use _FileListToArray). Once you have the 2 arrays, you then loop through the list of files (use For...Next here) and look for each one in the csv array (_ArraySearch is the command to use) - when you find a match you extract the folder data from the same element and then use FileMove to move the file.

Give it a go and see how you get on - you know where we are if you run into difficulties. :)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
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
Sign in to follow this  

×