简体   繁体   English

adf v2 中的文件名模式验证

[英]Filename pattern validation in adf v2

I would like to validate my input filename whether it's in specified name.我想验证我的输入文件名是否在指定的名称中。 Like my filename should be <> <> <>_<>.csv像我的文件名应该是 <> <> <>_<>.csv

Yes i am using event based i will get filename from trigger.是的,我正在使用基于事件的我将从触发器获取文件名。

expected format: company_contry_yearmonth_timestamp.CSV预期格式:company_contry_yearmonth_timestamp.CSV

There is no explicit regex way of validating if the incoming file name matches a pattern.没有明确的正则表达式方法来验证传入的文件名是否与模式匹配。 But if you are using activity like lookup or copy activity.但是,如果您正在使用查找或复制活动等活动。 You can specify in the source dataset settings a wildcard file name or file path to fetch a file matching the pattern.您可以在源数据集设置中指定通配符文件名或文件路径以获取与模式匹配的文件。

- wildcardFileName - 通配符文件名

The file name with wildcard characters under the given container and folder path (or wildcard folder path) to filter source files.给定容器和文件夹路径(或通配符文件夹路径)下带有通配符的文件名,用于过滤源文件。 Allowed wildcards are: * (matches zero or more characters) and?允许的通配符是:*(匹配零个或多个字符)和? (matches zero or single character). (匹配零个或单个字符)。 Use ^ to escape if your file name has a wildcard or this escape character inside.如果您的文件名中包含通配符或此转义字符,请使用 ^ 转义。 See more examples in Folder and file filter examples.在文件夹和文件过滤器示例中查看更多示例。

example:例子:

You can use a if condition, with an expression as below using contains()您可以使用 if 条件,使用contains()的表达式如下

Here a storage event trigger, gets the trigged file name into a parameter.这里是一个存储事件触发器,将触发的文件名获取到一个参数中。 We then use contains() function to see if the file name contains a specified string然后我们使用 contains() function 来查看文件名是否包含指定字符串

@contains(pipeline().parameters.filenameTriggered,'pattern')

在此处输入图像描述

在此处输入图像描述

If true a wait activity is executed.如果为真,则执行等待活动。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM