problems with file move script

Oct 2, 2008
19
0
#1
I have problems as noted in this script:


rem ---- loop through directories under j:\taqDAILYNBBO\ ----

rem --------------- enter a blank line ---------
echo ' '
rem ---------------- how do i enter a blank line?

for /r /D j:\taqDAILYNBBO\ %x in (*) (
echo file in J:= %x
echo %@filesize[%x]
iff %@filesize[%x]>5000000000 then

rem ------ both of the statement below give errors -----
rem if (%@filesize["%x\_A"]>100 .AND. %@filesize["%x\_ZZ"]>100) (
rem iff (%@filesize["%x\_A"]>100 .AND. %@filesize["%x\_ZZ"]>100) then


echo filesize for _ZZ in J:= %@filesize["%x\_ZZ"]
iff %@filesize["%x\_ZZ"]>100 then
echo data exists in J:

echo does directory exist in M:? %@filesize["m:\taqDAILYNBBO\%@substr[%x,16]"]
iff %@filesize["m:\taqDAILYNBBO\%@substr[%x,16]"] == -1 then
rem -- this is not working. what is the indication the the directory does not exist?
rem mkdir "m:\taqDAILYNBBO\%@substr[%x,16]"
endiff

rem ------- trying to list the files in %x, why does this not work? -------
for %x %y in (*) (
echo ticker= %y
)

echo file size in M:= %@filesize["m:\taqDAILYNBBO\%@substr[%x,16]\_a"]

iff %@filesize["m:\taqDAILYNBBO\%@substr[%x,16]\_a"] == -1 then
rem
echo enter file move command here
endiff
endiff
endiff
)

SOME OF THE OUTPUT FOLLOWS:

file in J:= J:\taqDAILYNBBO\20070712
0
file in J:= J:\taqDAILYNBBO\20070713
7350478392
filesize for _ZZ in J:= 554030
data exists in J:
does directory exist in M:? 0
C:\Program Files (x86)\JPSoft\TCMD9\mine\sz.btm [41] Usage : FOR [/A:[[-][+]rhsdaecjot] /D /F ["options"] /H /I"text" /L /R [path] /T"..."] %var IN ([@]set | start, ste
p, end) [DO] command ...
file size in M:= -1
enter file move command here

 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,667
46
Albuquerque, NM
prospero.unm.edu
#2
I strongly suggest that you post support requests in Take Command / Support. In Tips&Tricks, people may not find them....

I have problems as noted in this script:


rem ---- loop through directories under j:\taqDAILYNBBO\ ----

rem --------------- enter a blank line ---------
echo ' '
rem ---------------- how do i enter a blank line?
You can use ECHO. , just like in COMMAND.COM / CMD.EXE. Your idea works too; just use backquotes instead of apostrophes: ECHO ` `

I'm not going to spend much time deciphering your script, but I do notice:

iff %@filesize[%x]>5000000000 then
Remember that < and > are redirection operators. Comparison operators are GT (greater than), LT (less than), GE (greater than or equal), LE (less than or equal), and so on. Type HELP CONDITIONALEXPRESSIONS for more info.
 
#3
JP Software Forums" <[email protected]>; "rawood11 wrote:
| I have problems as noted in this script:
|
|
| rem ---- loop through directories under j:\taqDAILYNBBO\ ----
|
| rem --------------- enter a blank line ---------
| echo ' '
| rem ---------------- how do i enter a blank line?

Do you mean "enter a blank line into my batch file"? If so, that depends on
your editor. If you mean "How do I display a blank line", the simplest
command is

echo.

Note there is no space between the command name ECHO and the period. This is
a special technique that has been around at least since PC-DOS 3.3 in
COMMAND.COM
|
| for /r /D j:\taqDAILYNBBO\ %x in (*) (
| echo file in J:= %x
| echo %@filesize[%x]
| iff %@filesize[%x]>5000000000 then
|
| rem ------ both of the statement below give errors -----
| rem if (%@filesize["%x\_A"]>100 .AND. %@filesize["%x\_ZZ"]>100) (
| rem iff (%@filesize["%x\_A"]>100 .AND. %@filesize["%x\_ZZ"]>100)

The "less than" < and "greater than" > characters are special characters
used exclusively for redirection. You must use one of the operators GE GT LE
LT for comparisons. See help Topic "conditionalexpressions.htm"

I did not analyze the rest of your program. Please make the appropriate
corrections, and if still having problems, post just the problem part.
--
HTH, Steve