【发布时间】:2021-08-31 11:50:34
【问题描述】:
我有一个由竖线 (|) 分隔的 .dat 文件。现在我的专栏可以有 |在数据中。我在阅读此文件并逐列加载时遇到问题。
使用的 DML:
record
string("|") col1,
string("|") col2,
string("|") col3,
string("|") col4,
end
来源价值:
"Col1"|"col2"|"col3"|"col4"
"units of the price | currency used" | "ABC" | "20210831" | ""
所以 col1 = 价格单位 |使用的货币,col2 = ABC,col3 = 20210831,col4 = null
根据我的 dml,它打破了 2 中的第一个 col,因此失败了。 如何读取文件并使用正确的值加载它。
【问题讨论】:
-
也许您可以将分隔符定义为 string(\"|"\") 即使用“|”作为分隔符,而不是仅使用 | - 您将在开头和结尾添加一个额外的 "的记录,但以后很容易删除
标签: ab-initio