Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Pentaho DI(水壶),但不确定执行以下操作的最佳方法是什么:从下载的 csv 文件中,检查列是否存在,然后根据该选择正确的下一步。有 3 个可能的选项。
谢谢,艾萨克
您没有提到可能的选项,所以我将只为您提供一个草图,展示如何检查文件中是否存在列。
为此,您将需要CSV file input一步Metadata structure of stream一步地读取传入流的元数据。
CSV file input
Metadata structure of stream
对于具有 3 列的示例 csv 文件,您可以在单独的行中获取每一列,并将其名称作为元数据步骤中col1列col2中的值。col3Fieldname
col1
col2
col3
Fieldname
然后根据您的需要,您可以使用例如Filter Rows或Switch / Casestep 进行进一步处理。
Filter Rows
Switch / Case