> >>In .bat file:
> >>
> >>@ECHO OFF
> >>Cd C:\SQLite
> >>SQLite3 Test.db3 <@Commands.sql
it's quite OT, I think; anyhow try
@echo off
:
rem --- set disk/folder
pushd C:\SQLite
:
rem --- create a temp filename
set SQLCMD=%TEMP%\sql%RANDOM%.txt
:
rem --- populate the command file, see
rem ---
http://www.sqlite.org/sqlite.html
echo .mode csv >%SQLCMD%
echo .import Test.txt Table1 >>%SQLCMD%
echo .exit >>%SQLCMD%
:
rem --- execute the command file
SQLite3 Test3.db <%SQLCMD%
:
rem --- cleanup and terminate
del %SQLCMD%
set SQLCMD=
popd
the above will change the current drive/folder, set the environment
variable "SQLCMD" to a temporary, random file name, fill the file with
the SQLite commands, invoke "sqlite3.exe" feeding it the command file
and then clean after itself and restore the initial drive/folder;
notice that when populating the command file the first "echo" row uses
a single redirect sign ">" to create the file while the others use a
double one ">>" to append the other lines to it