删除 Talend 中的无效值

Remove invalid values in Talend

我有一个带有日期列的 excel 输入文件,其中一些日期不正确,在执行我的工作时,我收到以下错误

The cell format is not Date in ( Row. 128 and ColumnNum. 3 )
The cell format is not Date in ( Row. 172 and ColumnNum. 3 )
The cell format is not Date in ( Row. 315 and ColumnNum. 3 )
The cell format is not Date in ( Row. 406 and ColumnNum. 3 )

然后我想过滤这些值,这样我就可以避免这种错误 事实上,日期不正确的行包含值“-”,这意味着我们不知道正确的日期。如果我可以简单地过滤所有日期格式不正确的行,那就太好了。

我正在考虑过滤器或 If 条件,但由于我的输入列是日期,我遇到了一些困难。

有帮助吗?谢谢:)

您可以先从 excel 中检索日期字段作为字符串:这样您就不会收到任何错误。然后使用 tFilterRow,您可以排除日期为“-”的行。然后在 tMap 中使用 TalendDate.parseDate 方法将字符串转换为日期。