Nathana
(Lurker)
2004-06-23 08:03 PM
Wildcards when using "Move"

Every day I need to 'move' a file that has a different name each day but always starts with atm. I'm having a hard time using the wildcard in the move command. One day the file will be atm3152 and the next day it might be atm5487.
I would appreciate any ideas...the whole thing works if i put the entire file name in.


MOVE "C:\test\atm*.* " "C:\test\test"

$File = "C:\test\test"
$DLine = ' '
$Rline = '12'
$TempFile = + ".TMP"
$LineNum = 0

$Rcode = OPEN (1, $File, 2)
DEL $TempFile
$Rcode = OPEN (2, $TempFile, 5)

$Line = READLINE(1)
WHILE @Error = 0


$LineNum = $LineNum + 1
IF $Line = $DLine
$Rcode = WRITELINE(2, $RLine + Chr(13) + Chr(10))
ELSE
$Rcode = WRITELINE(2, $Line + Chr(13) + Chr(10))
ENDIF
$Line = READLINE(1)
LOOP
$Rcode = CLOSE(1)
$Rcode = CLOSE(2)
COPY $TempFile $File
DEL $TempFile


Les
(KiX Master)
2004-06-23 08:15 PM
Re: Wildcards when using "Move"

MOVE "C:\test\atm*.* " "C:\test\test"

works for me on XP with KiX 4.22

Not sure why you have a trailing space after *.*
You sould put a trailing hack on the folder name though.
MOVE "C:\test\atm*.*" "C:\test\test\"

What @ProductType and @KiX ?


Nathana
(Lurker)
2004-06-23 09:07 PM
Re: Wildcards when using "Move"

Sweet, You helped me alot. I was unfamiliar with the MOVE command. I was also trying to use it to rename.

Thanks