使用sqlite在Windows上将查询输出重定向到文本文件? [英] Redirect the query output to a text file with sqlite on windows?

查看:466
本文介绍了使用sqlite在Windows上将查询输出重定向到文本文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows中使用Sqlite做一些查询(我执行它 sqlite3 mydb.db ),但我不能重定向输出(我试图做一个像 .tables > new_db_output.txt 的正常命令行方式,因为sqlite作为一个程序运行在命令行。

I'm doing some queries using Sqlite in Windows (I execute it as sqlite3 mydb.db) but I can't redirect the output (I'm trying to do as a normal command line way like .tables > new_db_output.txt) because sqlite runs as an a program under the command line.

官方sqlite网页是一个名为将结果写入文件的部分,但不按我尝试的方式工作:

In the official sqlite web page is a section called Writting results to a file but doesn't work in the way I try:

.tables .output new_db_output.txt

两者皆不

.tables | .output new_db_output.txt

任何想要输出到文件?

注意:我正在使用sqlite3& Windows 7。 sqlite3 命令行的点命令

Note: I'm using sqlite3 & windows 7.

推荐答案

shell不能组合。

The dot commands of the sqlite3 command-line shell cannot be combined.

.output 会影响所有以下命令;只需先执行它:

.output affects all following commands; just execute it beforehand:

.output new_db_output.txt
.tables
.output

这篇关于使用sqlite在Windows上将查询输出重定向到文本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆