[英]How do I extract a file name from the filepath column using ADF expression builder?
I would like to get filename from below path using Visual expression builder in dataflow derived column in data factory.我想在数据工厂的数据流派生列中使用可视表达式生成器从路径下方获取文件名。
/datafactory/raw/files/filename.csv
every row has got filepath.每一行都有文件路径。 So filename is required in every row.所以每一行都需要文件名。
If the count of /
is fixed in your filepath, such as /datafactory/raw/files/filename.csv
, you can use this expression in Derived Column: split(filepath,'/')[5]
.Otherwise, you can try this expression: split(filepath,'/')[size(split(filepath,'/'))]
.如果/
的计数在您的文件路径中是固定的,例如/datafactory/raw/files/filename.csv
,您可以在派生列中使用此表达式: split(filepath,'/')[5]
。否则,您可以尝试这个表达式: split(filepath,'/')[size(split(filepath,'/'))]
。
Data preview of Derived Column:派生列的数据预览:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.