在 DataWeave 中读取带有 header=false 的 CSV 会导致输出中缺少第一行 [Logic 在 Online DWL Editor 中有效,但在 Studio 中无效]

问题描述 投票:0回答:0

读取没有标题的 CSV 文件,但是输出缺少 CSV 文件中不是标题的第一行。

尝试将 csv 转换为 json,但在执行以下步骤后,它可以在在线数据编织编辑器中工作,但不能在工作室中工作。

https://help.mulesoft.com/s/article/In-DataWeave-reading-CSV-with-header-false-causes-the-missing-first-line-in-the-output

输入CSV:

RSK,IP,PI,PI2016007219,PI,Tug & Barge Fleet Protection & Indemnity~73835~02/20/2015,,Open,90300815,D,20170616,,S17616R,R04,210.91,99,,C,james kristovich,1550811,01,a010V00000oIjJEQA0
RSK,IP,PI,PI2016007220,PI,Tug & Barge Fleet Protection & Indemnity~73835~02/20/2015,,Open,90300815,D,20170616,,S17616R,R04,210.91,99,,C,james kristovich,1550811,01,a010V00000oIjJEQA0

预期产出:

[
  {
    "Source Abbr": "RSK",
    "Transaction Type": "IP",
    "Claim Type": "PI",
    "Claim Number": "PI2016007219",
    "Coverage Line": "PI",
    "Policy": "Tug & Barge Fleet Protection & Indemnity~73835~02/20/2015",
    "Policy Section": "",
    "Claim Status": "Open",
    "Bus. Entity": "90300815",
    "Invoice Type": "D",
    "Date of Invoice": "20170616",
    "Invoice Due Date": "",
    "Invoice Number": "S17616R",
    "Transaction Code": "R04",
    "Amount": "210.91",
    "Transaction Comment Type": "99",
    "Transaction Comment": "",
    "Check Comment Type": "C",
    "Check Comment": "james kristovich",
    "Payee CVIF Number": "1550811",
    "Payee CVIF Location": "01",
    "Riskonnect UID": "a010V00000oIjJEQA0"
  },
  {
    "Source Abbr": "RSK",
    "Transaction Type": "IP",
    "Claim Type": "PI",
    "Claim Number": "PI2016007220",
    "Coverage Line": "PI",
    "Policy": "Tug & Barge Fleet Protection & Indemnity~73835~02/20/2015",
    "Policy Section": "",
    "Claim Status": "Open",
    "Bus. Entity": "90300815",
    "Invoice Type": "D",
    "Date of Invoice": "20170616",
    "Invoice Due Date": "",
    "Invoice Number": "S17616R",
    "Transaction Code": "R04",
    "Amount": "210.91",
    "Transaction Comment Type": "99",
    "Transaction Comment": "",
    "Check Comment Type": "C",
    "Check Comment": "james kristovich",
    "Payee CVIF Number": "1550811",
    "Payee CVIF Location": "01",
    "Riskonnect UID": "a010V00000oIjJEQA0"
  }
]

在线 Dataweave 编辑器逻辑工作如下: Online Dataweave editor logic

相同的逻辑在 studio v7.13 中不起作用。有效负载的大小是 1 而不是 2

Same logic is not working in studio v7.13

dataweave mule4 csvtojson
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.