Jump to content

create a bunch of new folders from spreadsheet fi


Recommended Posts

Guest lyndathomson
Posted

I am new to AutoIt and am trying to create about 500 new folders in an XP environment. I really want these to be on a network drive, but as long as I can get them somewhere, I figure I can just move them. I have the folder names in a spreadsheet and just want to create them all in one fell swoop - seems liek it should be possible, but I didn't get anywhere trying to create my fist script - can anyone help me? Thanks.

Posted

I am new to AutoIt and am trying to create about 500 new folders in an XP environment.  I really want these to be on a network drive, but as long as I can get them somewhere, I figure I can just move them.  I have the folder names in a spreadsheet and just want to create them all in one fell swoop - seems liek it should be possible, but I didn't get anywhere trying to create my fist script - can anyone help me?  Thanks.

<{POST_SNAPBACK}>

You have 3 posebilitys here to do what you want:

1) If you know some VBA you can do it within excell (can use the AutoItX3.dll for that)

2) Acces your Excellsheet with COM from an AutoIt script

3) Export your xls file to csv, and read it in with AutoIt.

For additional help just post your script and we can see where you got stuck :)

Posted (edited)

Easist way:

- Export the spreadsheet to a plain text file. For sake of example, I'll assume that the resulting

C:\example\blah\blah\

C:\foo\bar\

C:\another\folder\

FolderRelativeToWorkingDirectory

C:\blah\

- Look at the DirCreate and FileReadLine functions in the help file.

The following example is from the FileReadLine documentation with only one thing changed:

$file = FileOpen("test.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

; Read in lines of text until the EOF is reached
While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop
    DirCreate($line)
Wend

FileClose($file)
Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Guest lyndathomson
Posted

awesome!!! worked like a charm - thanks so much.

Guest lyndathomson
Posted

awesome!!! worked like a charm - thanks so much.

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
×
×
  • Create New...