技术文章 - CS178046

Windchill PDMLink 10.2 中,运行 CSV2XML 工具时 CSV 文件第一行未被转换为 XML 文件内容

已修改: 02-Jun-2016   


适用于

  • Windchill PDMLink 10.2 F000 - M020

说明


  • 运行 CSV2XML 工具时 CSV 文件第一行未被转换为 XML 文件内容
  • CSV 文件编码为 UTF-8
  • CSV 文件第一行不是以 # 开始的注释
    • 例如,CSV 文件内容如下
BeginWTDocument,Doc1.txt,Doc1,DOC-000001,SubDoc,Document-Descriptioin,DESIGN,/Default,,,,INWORK,,A,1,
#IBAValue~definition~value1~value2~dependency_id
IBAValue,ts.centos.A1,2012-03-08 01:02:03.000000000,,
IBAValue,ts.centos.A1,2012-03-09 01:02:03.000000000,,
#EndWTDocument,primarycontenttype,path,format,contdesc,parentContainerPath,,,,,,,,,,
EndWTDocument,ApplicationData,/Doc1.txt,,,,,,,,,,,,,
  • 运行 CSV2XML 命令时使用了参数 -encoding utf8
    • 例如,为上述 CSV 文件运行 windchill wt.load.util.CSV2XML -input documents.csv -root /root/Documents/ -encoding utf8 以后得到具有下面内容的 XML 文件。请注意 XML 文件中没有标签 BeginWTDocument
<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standardX24.dtd">
<NmLoader>
 
<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
    <csvdefinition>ts.centos.A1</csvdefinition>
    <csvvalue1>2012-03-08 01:02:03.000000000</csvvalue1>
    <csvvalue2></csvvalue2>
    <csvdependency_id></csvdependency_id>
</csvIBAValue>
 
<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
    <csvdefinition>ts.centos.A1</csvdefinition>
    <csvvalue1>2012-03-09 01:02:03.000000000</csvvalue1>
    <csvvalue2></csvvalue2>
    <csvdependency_id></csvdependency_id>
</csvIBAValue>
 
<csvEndWTDocument handler="wt.doc.LoadDoc.endCreateWTDocument" >
    <csvprimarycontenttype>ApplicationData</csvprimarycontenttype>
    <csvpath>/Doc1.txt</csvpath>
    <csvformat></csvformat>
    <csvcontdesc></csvcontdesc>
    <csvparentContainerPath></csvparentContainerPath>
</csvEndWTDocument>
 
</NmLoader>
这是文章 178046 的 PDF 版本,可能已过期。最新版本 CS178046