Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hello
i would like to import generated file from the Cisco router ACS " it generates a new file containing all the username...." at 12:01 AM, i created the DTS package, and the batch file:
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET DATE=%%B
REM Export DIR listing to D:\MyImport\Dirlist.txt
dir D:\MyImport\DATE.csv /b > D:\MyImport\Dirlist.txt
for /f "tokens=3 delims=," %%i in (D:\MyImport\Dirlist.txt)
do "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\DTSrun.exe" -F
"D:\myimport\MyImportDTS.dts" -Uimportuser -Pimport -A"ServerName"=
"SQL" -A"FileName"="D:\myimport\%%i" -A"DatabaseName"="Bank"
REM Rename all the files with "old" as suffix
ren D:\myimport\*.csv *.csvoldthe error is " the syntax of the command is incorrect" for line " for/f tokens =3..."
do you have an idea what's the problem?
My best regards
Layla

that's the update batch file....but still not working...it stops running on the "for /f "tokens=*" %%i in (D:\MyImport\Dirlist.txt)" and it gave me the message: the syntax of the command is incorrect"....the file Dirlist.txt contains the name of one file: ex 2004-07-09
REM Type: Batch File
REM Created by: layla
REM Import all csv files to SQL Server using DTS
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET DATE=%%B
REM Export DIR listing to D:\MyImport\Dirlist.txt
dir D:\MyImport\%DATE%.csv /b > D:\MyImport\Dirlist.txt
for /f "tokens=*" %%i in (D:\MyImport\Dirlist.txt)
do "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\DTSrun.exe" -F
"D:\myimport\MyImportDTS.dts" -Uimportuser -Pimport -A"ServerName"=
"SQL" -A"FileName"="D:\MyImport\%%i" -A"DatabaseName"="layla"
REM Rename all the files with "old" as suffix
ren D:\myimport\*.csv *.csvoldthanks

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |