Jump to content

another loop problem


jben
 Share

Recommended Posts

:D Not sure what I can do...

I'm really grateful for all the posts..But just don't have a clue which route to take...Loops...then the mention of using a text file.....then functions...My heads going to explode i think.

sorry i bumped this post up, just hoping someone will come to my rescue and give me an idea of how I could progress with this, just don't have enough knowledge to truely understand what my options are and how to implement them.

Edited by jben
Link to comment
Share on other sites

This code below almost works...Anyone have any ideas what might be missing..Thanks

Update

-------

Silly me I had a piece of the code commented out..It works now..

I do have 1 last question though. How can I add more items to the array?

#include <Array.au3>
#include <File.au3>

Global $targetDir
Global $aZipList

$F_Array = __FldrListToArray("C:\EXTRCT_TEMP\28667C_11037\", 0)
$F_Array = _loop($F_Array)
_ArrayDisplay($F_Array)

Func _loop($F_Array)
    For $I = 1 To Ubound($F_Array) -1
    $targetDir = $F_Array[$I];this code states that the targetdir is the information provided via the $F_Array
 ;the purpose in this is because the $F_Array obtains the folder within the 29944M_10386 folder to complete
 ;the string, which is then used in the code below to rename the .zip file.
    MsgBox(0, "", $targetDir)
    $aZipList = _FileListToArray($targetDir,"*.zip",0)
 If IsArray($aZipList) Then FileMove($targetDir & $aZipList[1], $targetDir & "DATA_CHILD.zip");renames zip
    Next
Return $aZipList
EndFunc
Edited by jben
Link to comment
Share on other sites

This is my idea...Does this seem correct?....Many thanks

edit: no the code doesn't work :-(

#include <Array.au3>
#include <File.au3>

Global $targetDir
Global $aZipList

$F_Array1 = __FldrListToArray("C:\EXTRCT_TEMP\28667C_11037\", 0)
$F_Array2 = __FldrListToArray("C:\EXTRCT_TEMP\28667C_123456\", 0)
$F_Array = _loop($F_Array1,$F_Array2)

Func _loop($F_Array1,$F_Array2)
    For $I = 1 To Ubound($F_Array) -1
    $targetDir = $F_Array[$I];this code states that the targetdir is the information provided via the $F_Array
  ;the purpose in this is because the $F_Array obtains the folder within the 29944M_10386 folder to complete
  ;the string, which is then used in the code below to rename the .zip file.
    $aZipList = _FileListToArray($targetDir,"*.zip",0)
    If IsArray($aZipList) Then FileMove($targetDir & $aZipList[1], $targetDir & "DATA_CHILD.zip");renames zip
    Next
Return $aZipList
EndFunc
Edited by jben
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...