excel - 如何将 latex 和 excel 连接到 postgres?

标签 excel postgresql latex

<分区>

是否可以从 excel 运行 postgres 查询并在 excel 中获取结果?

是否可以从 latex 运行 postgres 查询并在查询位置获取结果?

latex 的答案:我能够通过此链接直接在 latex 中获得 postgres 查询的结果 http://hgesser.com/software/latexdb/

最佳答案

您可以通过 ODBC driver 从 Excel 连接到 Postgres .过程类似于文章 article 中描述的 MySQL .如何传输某些查询结果的第二种通用​​可能性是导出为 CSV 格式文件并在 Excel 中导入。它很简单,而且通常很完美。

[pavel@localhost ~]$ psql postgres
psql (9.1.9, server 9.4devel)
WARNING: psql version 9.1, server version 9.4.
         Some psql features might not work.
Type "help" for help.

postgres=# \copy (SELECT * FROM pg_database) TO ~/data.csv CSV HEADER
postgres=# \q
[pavel@localhost ~]$ tail ~/data.csv 
datname,datdba,encoding,datcollate,datctype,datistemplate,datallowconn,datconnlimit,datlastsysoid,datfrozenxid,datminmxid,dattablespace,datacl
template1,10,6,en_US.UTF-8,en_US.UTF-8,t,t,-1,12948,1879,1,1663,"{=c/postgres,postgres=CTc/postgres}"
template0,10,6,en_US.UTF-8,en_US.UTF-8,t,f,-1,12948,1879,1,1663,"{=c/postgres,postgres=CTc/postgres}"
postgres,10,6,en_US.UTF-8,en_US.UTF-8,f,t,-1,12948,1879,1,1663,

您可以将相同的机制用于 latex http://texblog.org/2012/05/30/generate-latex-tables-from-csv-files-excel/

关于excel - 如何将 latex 和 excel 连接到 postgres?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18447796/

相关文章:

excel - 使用字符串作为输入时 GetValue 函数中的类型不匹配

sql - 如果我在 LIKE 之前的字符串中放置通配符,而不是在 LIKE 之后的字符串中放置通配符,为什么会得到不同的结果

python - 修复 Python 的 Pg 中的类型错误

r - 如何将不同的数字格式应用于 R 中的每一行

javascript - 将 html 表导出到 Excel javascript 函数特殊字符已更改

excel - vba 代码中的多个 Worksheet_Change 事件

excel - VBA 查找和替换行条目

python - Django: 'Data' 对象没有属性 'save'

latex - Latex 中的问题 : "There' s no line here to end"

python - 从格式为 .tex 的 arXiv 文章中仅提取正文