AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

What type of a loop

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Greener than a newb
Guest





PostPosted: Fri Sep 04, 2009 5:54 pm    Post subject: What type of a loop Reply with quote

what type of loop is this?

I have the following csv file with this info:
Frequency,Filename,Destination,Destination Filename

Sample file
------------------------
Daily,File01.txt,G:\Daily\Somewhere,DailyFile_%Date%.txt
Weekly,File02.txt,G:\Weekly\Somewhere,WeeklyFile_%Date%.txt
Monthly,File03.txt,G:\Monthly\Somewhere,MonthlyFile_%Date%.txt
------------------------

What type of loop do i create?

I know it has to read the file first and then copy each file line by line.
Back to top
Greener than a newb
Guest





PostPosted: Fri Sep 04, 2009 5:56 pm    Post subject: Reply with quote

Sorry...

I want the script to read each line and copy the corresponding file to the destination using the destination name.
Back to top
purloinedheart



Joined: 04 Apr 2008
Posts: 537
Location: Canada

PostPosted: Fri Sep 04, 2009 6:06 pm    Post subject: Reply with quote

Quote:

know it has to read the file first and then copy each file line by line.


First get the directory alone, then store in variable 'Dir'
Code:

Loop Parse, Dir, `n
 FileRead File_%A_Index%, %A_LoopField% ; File1, File2, etc contain the line with the filename

Then do the same with the other file

Not tested - may need some debugging
Back to top
View user's profile Send private message
greener than newb
Guest





PostPosted: Fri Sep 04, 2009 6:12 pm    Post subject: Reply with quote

thanks for pointing me in the right direction...

will work on it.
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group