Directory and File Pathnames Reader Parameters
快速链接 |
|
---|---|
路径参数
![Closed](http://www.baooytra.com/docs/fme/2017.1/html/FME_Desktop_Documentation/FME_ReadersWriters/path/../Skins/Default/Stylesheets/Images/transparent.gif)
指定查找文件和文件夹时要使用的搜索模式。只有与路径过滤器匹配的文件名和文件夹名才会作为功能输出。
This parameter is optional, but defaults to reading all contents of the current directory using a glob pattern of*. 如果未指定,则不会尝试将路径解释为全局模式。这允许将路径中的特殊glob字符视为文本–根据文件的设置,从reader dataset文件夹返回所有文件、文件夹或两者Allowed Path Type.
注:The Path Filter is a glob pattern for matching file or folder names. Recursion and some limited name filtering is possible, but full regular expressions are not supported and the syntax is not identical.
The Path Filter allows these selections:
- 通过指定相对路径,在读取器数据集文件夹中指定一组特定的文件和/或文件夹;或
- files and/or folders from an entirely different path using an absolute path, in which case the reader dataset will be ignored.
For example, a dataset of 温度:/temp/ and a Path Filter of *.csv文件 will return all files with a csv extension in the温度:/tempfolder, but regardless of the reader dataset specifying a Path Filter ofc:/temp/*.csv文件will produce the same set of features. 注:由于模式中的其他字符,某些表达式可能无法正确解释为绝对路径或UNC路径。 |
在读取器数据集和路径过滤器选项中都可以使用模式。为了获得更好的性能,建议在路径滤波器instead of the reader dataset.
例如,不使用 c:/temp/**/*.csv文件 and not using the Path Filter option, use a dataset of 温度:/temp/ and a Path Filter of **/*.csv 为了更快的结果。 Note if using a Path Filter that is relative to the reader dataset, the trailing slash between the dataset and the path filter is optional and will be added if needed. |
通配符 |
Description |
例子 |
比赛 |
不匹配 |
---|---|---|---|---|
? |
不区分大小写地匹配任何单个字符。 |
?在 | 猫,猫,蝙蝠,蝙蝠 | 在 |
* |
不区分大小写匹配零个或多个字符的任意序列。 此匹配可以出现在文件夹名、文件名或文件扩展名中,并且可以多次使用。 |
法律* | 法律,法律,法律,律师 | GrokLaw |
** For performance reasons, it is recommended that you use this option in the Path Filter instead of the reader dataset. |
比赛the current folder and recursively all subfolders. |
**\法律\* | Temp\Law\a, Temp\Law\b, Temp2\Law\A, Temp2\Law\B | Temp\Junk\a |
[美国广播公司] |
比赛a single character case sensitively | [CB]在 | Cat, Bat | 猫还是蝙蝠 |
[a-z] | 匹配a-z范围内的任何单个字符(包括a-z)并区分大小写 | [a-z]001号 | a001或b001等。 | A001和a002 |
[0-9] | 匹配0-9(含0-9)范围内的任何单个数字。 | Letter[4-5] | 信4,信5 | 字母,字母,字母1 |
[a-zA-Z] | 比赛any single character in the range a-z or A-Z inclusive and case-sensitively. | 测试[a-zA-Z] | 测试AB, testab, testAz, or testZa | 测试 |
{ab,cd,e} |
比赛any of the strings ab or cd or e. | Dir{One,Two} | 迪隆,迪隆 | 第三,第二 |
\\计算机\dir | 匹配绝对UNC网络路径。 | \\组件\临时 |
笔记:
- 路径过滤器是全局模式,而不是正则表达式。
- 如果提供的值是相对路径,那么它将分别对应于数据集。
- If it is an absolute or UNC path, then it will be treated as such. Note that some expressions may not be interpreted correctly as absolute or UNC paths due to other characters in the pattern.
- 使用正斜杠作为分隔符将提供最佳结果,因为正斜杠既不与glob转义字符冲突,也不与UNC路径名冲突。
Additional Examples Relative to the Reader Dataset
*dgn先生 | 匹配读取器数据集文件夹中以.dgn扩展名结尾的所有文件。 |
**/*.dgn | 匹配读卡器数据集文件夹及其下以.dgn扩展名结尾的任何子文件夹中的所有文件。 |
{data,archive}/*.dgn | 匹配以.dgn扩展名结尾的数据或存档子文件夹中读取器数据集文件夹中的所有文件。 |
/数据/92?034.dgn公司 | 匹配读卡器数据集文件夹的数据子文件夹中以92开头、具有任何单个字母或数字字符并以034.dgn结尾的所有文件。 |
92[a-z]034.dgn号 | 匹配读卡器数据集文件夹中以92开头的所有文件,然后是任何一个小写字母,最后是034.dgn。 |
C:/data/*.dgn | 比赛all files in the c:/data folder that end with a .dgn extension. |
C:/data/**/*.dgn | 匹配c:/data文件夹和扩展名为.dgn的任何子文件夹中的所有文件。 |
C:/**/*.dgn | 比赛all files on the entire C: drive that end with a .dgn extension. |
C:/{data,archive}/*.dgn | 匹配c:\data和c:\archive文件夹中以.dgn扩展名结尾的所有文件。 |
C:\数据\*.dgn |
Single backslashes are interpreted as escape characters in the pattern. You can use forward slashes for path separators (C:/data/*.dgn), or escape the backslashes so they are treated as literals (C:\\data\\*.dgn). |
\\我的文件夹\*.csv |
If我的文件夹is a folder instead of a host, this will fail. Instead, use forward slashes for UNC paths and omit the leading separator for relative paths. For example: //我的主机/*.csv 我的文件夹/*.csv |
C[:]/*.txt |
指定glob模式语法有时会与路径解释冲突。 In this case, the optionality of the colon character prevents the recognition of the absolute path drive letter. You can try different combinations of the dataset and filter – these combinations may or may not succeed, depending on the conflict. |
C:[数据] | 指定glob模式语法有时会与路径中的特殊字符冲突。 在本例中,目录包含方括号[]which, by default, will be misinterpreted as a glob pattern. To ensure it is read correctly, remove the default glob pattern asterisk*和离开路径过滤器是空的。这将禁用glob interpretation and the path will be interpreted literally. |
C:\\**\\*.dgn |
**glob expansions only work with forward slashes. 要避免此问题,请对路径分隔符使用正斜杠。例如: C:/**/*.dgn |
![Closed](http://www.baooytra.com/docs/fme/2017.1/html/FME_Desktop_Documentation/FME_ReadersWriters/path/../Skins/Default/Stylesheets/Images/transparent.gif)
指定是搜索包含文件和文件夹的任何路径类型,还是仅搜索文件或文件夹。
![Closed](http://www.baooytra.com/docs/fme/2017.1/html/FME_Desktop_Documentation/FME_ReadersWriters/path/../Skins/Default/Stylesheets/Images/transparent.gif)
指定是否为返回的每个匹配文件或文件夹填充文件属性。
If set to是的,下表中的属性将在具有相应时间戳、文件大小、所有者名称和只读属性的文件和文件夹的输出功能上设置。
See the特征表示有关每个特定属性的信息。
If set toNo,属性仍将存在,但其值设置为空字符串“”。将此参数设置为No有时可以提高性能。
文件属性 |
---|
path_modified_date |
path_accessed_date |
路径\创建\日期 |
路径\文件大小 |
路径所有者名称 |
path_readonly |