我有一个由竖线 (|) 分隔的 .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,因此失败了。如何读取文件并使用正确的值加载它。