我试着加载数据。这不管用。
我试过的是:
多个分隔符,所有带引号的字段,所有字段不包含,数据中没有标头,mlcp中没有分隔符选项,mlcp中的其他分隔符选项,其他计算机,其他ML8版本,其他Java版本,更少的数据,更多的数据,有或没有转换。
我的shell脚本:
#!/bin/bash
# Data laden met transform
#############################################
mlcp.sh import \
-host localhost \
-port 37041 \
-username admin \
-password admin \
-input_file_path sampledata/DIKW \
-input_file_type delimited_text \
-delimiter ";" \
-transform_module /ext/obi/transform/dikw-transform-eval.xqy \
-transform_namespace "http://marklogic.com/dikw" \
-mode local \
-thread_count 1 \
-transaction_size 1 \
-batch_size 1数据
"INCIDENTID";"DATUM";"TIJD";"HECTOMETERAANDUIDING";"WEGNAAM";"KORTBESCHRIJVING"
161236;02-08-14 00:00;1839-11-23 17:05:20;13.3;A14;"a- 1pa" 错误
15/10/29 11:15:23 ERROR contentpump.DelimitedTextReader: (line 0) invalid char between encapsulated token end delimiter发布于 2015-10-29 16:08:30
看看这个博客用MLCP摄取定界文本,它解释了这种问题的原因,以及该做些什么。简而言之,您之所以看到这个错误,主要是因为您有如下一些数据:
"first"name;lastName;middle这里的第一列是无效的CSV列,因为您不能在字段中有引号,除非您转义它。有关更多细节,请参阅帖子。
尽管在您提出问题的数据示例中,这似乎还可以。但是,仍然请确保在原始数据中,您不会在字段中间留下任何双引号。顺便问一下,您使用的mlcp版本是什么?
发布于 2015-10-29 17:22:56
在使用非标准分隔符时,我已经看到使用选项文件更好。
options.txt:
import
-host
localhost
-port
37041
-username
admin
-password
admin
-input_file_path
sampledata/DIKW
-input_file_type
delimited_text
-delimiter
;
-transform_module
/ext/obi/transform/dikw-transform-eval.xqy
-transform_namespace
http://marklogic.com/dikw
-mode
local
-thread_count
1
-transaction_size
1
-batch_size
1注意,这允许您跳过分号周围的引号。然后:
mlcp.sh -options_file options.txthttps://stackoverflow.com/questions/33411676
复制相似问题