Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
b939ab5f
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b939ab5f
编写于
8月 14, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CSV exporter quote char config
Former-commit-id:
4949027d
上级
ddfca05d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
4 deletion
+10
-4
docs/todo.txt
docs/todo.txt
+0
-3
plugins/org.jkiss.dbeaver.core/plugin.xml
plugins/org.jkiss.dbeaver.core/plugin.xml
+1
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/stream/impl/DataExporterCSV.java
...s/dbeaver/tools/transfer/stream/impl/DataExporterCSV.java
+9
-1
未找到文件。
docs/todo.txt
浏览文件 @
b939ab5f
MongoDB driver (3.x)
Folders colors customization.
DB toolbar/menu visibility config in Eclipse mode
MacOS test
Eclipse Mars update
OpenSUSE test (UI is broken)
...
...
@@ -11,7 +9,6 @@ Objects cache. Allow to load single object without entire cache loading (for tab
Remove QMDB warnings from main Error Log
Delete button in doc editors. Disable all RSV actions when in editor (inline/over)
Export to CSV - configure quote character
Split core and ui on different plugins
DBeaver features usage model
Vertica keywords
...
...
plugins/org.jkiss.dbeaver.core/plugin.xml
浏览文件 @
b939ab5f
...
...
@@ -2365,6 +2365,7 @@
<property
id=
"delimiter"
label=
"%dataTransfer.processor.csv.property.delimiter.name"
type=
"string"
description=
"%dataTransfer.processor.csv.property.delimiter.description"
defaultValue=
","
required=
"true"
/>
<property
id=
"header"
label=
"%dataTransfer.processor.csv.property.header.name"
type=
"string"
description=
"%dataTransfer.processor.csv.property.header.description"
defaultValue=
"top"
required=
"true"
validValues=
"none,top,bottom,both"
/>
<property
id=
"escape"
label=
"%dataTransfer.processor.csv.property.escape.name"
type=
"string"
description=
"%dataTransfer.processor.csv.property.escape.description"
defaultValue=
"quotes"
required=
"true"
validValues=
"quotes,escape"
/>
<property
id=
"quoteChar"
label=
"%dataTransfer.processor.csv.property.quoteChar.name"
type=
"string"
description=
"%dataTransfer.processor.csv.property.quoteChar.description"
defaultValue=
"""
required=
"false"
/>
</propertyGroup>
</processor>
<processor
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/stream/impl/DataExporterCSV.java
浏览文件 @
b939ab5f
...
...
@@ -18,6 +18,7 @@
package
org.jkiss.dbeaver.tools.transfer.stream.impl
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.DBConstants
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.data.DBDAttributeBinding
;
import
org.jkiss.dbeaver.model.data.DBDContent
;
...
...
@@ -41,6 +42,7 @@ public class DataExporterCSV extends StreamExporterAbstract {
private
static
final
String
PROP_DELIMITER
=
"delimiter"
;
private
static
final
String
PROP_HEADER
=
"header"
;
private
static
final
String
PROP_QUOTE_CHAR
=
"quoteChar"
;
public
static
final
char
DEF_DELIMITER
=
','
;
enum
HeaderPosition
{
...
...
@@ -75,6 +77,10 @@ public class DataExporterCSV extends StreamExporterAbstract {
}
else
{
delimiter
=
DEF_DELIMITER
;
}
String
quoteStr
=
String
.
valueOf
(
site
.
getProperties
().
get
(
PROP_QUOTE_CHAR
));
if
(!
CommonUtils
.
isEmpty
(
quoteStr
))
{
quoteChar
=
quoteStr
.
charAt
(
0
);
}
out
=
site
.
getWriter
();
rowDelimiter
=
GeneralUtils
.
getDefaultLineSeparator
();
try
{
...
...
@@ -129,7 +135,9 @@ public class DataExporterCSV extends StreamExporterAbstract {
DBDContent
content
=
(
DBDContent
)
row
[
i
];
try
{
DBDContentStorage
cs
=
content
.
getContents
(
monitor
);
if
(
ContentUtils
.
isTextContent
(
content
))
{
if
(
cs
==
null
)
{
writeCellValue
(
DBConstants
.
NULL_VALUE_LABEL
,
false
);
}
else
if
(
ContentUtils
.
isTextContent
(
content
))
{
writeCellValue
(
cs
.
getContentReader
());
}
else
{
getSite
().
writeBinaryData
(
cs
.
getContentStream
(),
cs
.
getContentLength
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录