Sign in to follow this  
Followers 0
agent47

moving txt files using array

4 posts in this topic

hi thnx,

I was trying on the code and i am not able to perform the operation so can u kindly fix a bug in my code

#include <file.au3>
Dim $aArray
Dim $path
Dim $path1
Dim $i
Dim $fila
Dim $filo
$path="c:\rpt.txt"
$path1="c:\rpt1.txt"
$fila=_FileReadToArray($path,$aArray)
If @error  Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
$filo=_FileReadToArray($path1,$aArray)
If @error Then
      MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
$aArray=$aArray[$i]
 For $i = 1 to 10
   $aArray = FileMove($fila,$filo & "\",8)
Next
FileClose($fila)
FileClose($filo)
MsgBox(0,"File","moved")

Kindly help with this

thnx

rpt.txt

rpt1.txt

Share this post


Link to post
Share on other sites



Hi,

try this:

#include <file.au3>
Local $path="c:\rpt.txt"
Local $path1="c:\rpt.txt"
Local $i
Dim $fila
Dim $filo
_FileReadToArray($path,$fila) ; reading c:\rpt.txt into array
If @error  Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
_FileReadToArray($path1,$filo) ; reading c:\rpt1.txt into array
If @error Then
      MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $i = 1 to UBound ($fila) - 1
    $split = StringSplit ($fila [$i], "\") ; get mp3 file name, last value from array $split is filename
    FileMove($fila [$i],$filo [$i] & "\" & $split [UBound ($split) - 1],8)
    MsgBox (0,"File moved", $fila [$i] & @CRLF & $filo [$i] & "\" & $split [UBound ($split) - 1])
Next
;MsgBox(0,"File","moved")

;-))

Stefan

Share this post


Link to post
Share on other sites

Hi,

try this:

#include <file.au3>
Local $path="c:\rpt.txt"
Local $path1="c:\rpt.txt"
Local $i
Dim $fila
Dim $filo
_FileReadToArray($path,$fila) ; reading c:\rpt.txt into array
If @error  Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
_FileReadToArray($path1,$filo) ; reading c:\rpt1.txt into array
If @error Then
      MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $i = 1 to UBound ($fila) - 1
    $split = StringSplit ($fila [$i], "\") ; get mp3 file name, last value from array $split is filename
    FileMove($fila [$i],$filo [$i] & "\" & $split [UBound ($split) - 1],8)
    MsgBox (0,"File moved", $fila [$i] & @CRLF & $filo [$i] & "\" & $split [UBound ($split) - 1])
Next
;MsgBox(0,"File","moved")

;-))

Stefan

Hey, Many Thanks it is working

Share this post


Link to post
Share on other sites

Dude - when you are asking for help, stick to your original thread. ;)

If I'm not wrong this is the 4th thread open for the same issue and that's a big No-No.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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  
Followers 0