Hey guys! I need a script that can write to (and read from) a file on a ftp host. The ftp command in Command doesn't help at all. I tried doing "help ftp", doesn't work..."ftp /?" just says unknown host...
Can anyone help?
Also, I've been having trouble with this little code I found a while back.
@echo off
setlocal
:loop
echo -----
set fname=testfilelines.txt
for /f "tokens=* delims=" %%x in (%fname%) do (
call set /a dx=%%dx%%+1
)
set /a last=%dx%-22
if %last% LSS 0 (
for /f "tokens=* delims=" %%x in (%fname%) do (
call set /a idx=%%idx%%+1
call set array.%%idx%%=%%x
)
) else (
for /f "skip=%last% tokens=* delims=" %%x in (%fname%) do (
call set /a idx=%%idx%%+1
call set array.%%idx%%=%%x
))
for /l %%x in (1,1,%idx%) do call echo %%array.%%x%%
echo -----
ping localhost -n 2 -w 1000 > nul
cls
goto loop
I'm trying to get it to only display 22 lines (which works fine) and also auto-update every second. The latter doesn't work...For some reason, if a file contains less than 22 lines, then it will just repeat the lines untill there are 22 in display...and if there are 22 or more, it doesn't auto update...
The type command is not what I'm looking for, as it is the main reason why I wanted this code. Type will display ALL the contents, I found that when it loops, it gets jumpy on refreshing.
If you can help with one or more problems, that would be great!