在 Pentaho Spoon 中使用多个通配符作为子目录路径

发布于 2025-01-17 20:00:05 字数 1090 浏览 4 评论 0原文

我试图使用 GetFiles 步骤来检索文件名中包含工作表且子目录路径中具有通用名称的 .xlsx 类型的所有文件。

示例目录内容:

c:\DATA\a1 info\a1 z information\a1 box\a1 b2 NEW\a1 sheet.xlsx
c:\DATA\a1 info\a2 zx information\a2 box\a2 b2 NEW\a2 sheet.xlsx
c:\DATA\a1 info\a3 zy information\a3 box\a3 b2 NEW\a3 sheet.xlsx
c:\DATA\a1 task\a1 z task\a1 box\a1 b2 new\sheet.xlsx
c:\DATA\a1 task\a1 z task\a1 box\a1 b2 new\sheet.xlsx

我只想要具有以下约束的文件的文件名:

Home directory is c:\DATA
The first subdirectory having info in the name.
The second subdirectory having information in the name
The third subdirectory having box in the name
The fourth subdirectory having NEW

我已经尝试过,

File/Directory  Wildcard (RegExp)   Exclude wildcard               Required Include subfolders
C:\DATA\        .*.info\.*.information\.*.box\.*.NEW\.*.sheet.*.xlsx            N       Y
C:\DATA\        .+info\.*.information\.*.box\.*.NEW\.*.sheet.*.xlsx             N       Y
C:\DATA\        .*info\.*information\.*box\.*NEW\.*sheet.*.xlsx             N       Y

但我不知所措。 提前致谢。

I was trying to use the GetFiles step to retrieve all files that are type .xlsx having sheet in the filename and having common names in the subdirectories path.

example directory contents:

c:\DATA\a1 info\a1 z information\a1 box\a1 b2 NEW\a1 sheet.xlsx
c:\DATA\a1 info\a2 zx information\a2 box\a2 b2 NEW\a2 sheet.xlsx
c:\DATA\a1 info\a3 zy information\a3 box\a3 b2 NEW\a3 sheet.xlsx
c:\DATA\a1 task\a1 z task\a1 box\a1 b2 new\sheet.xlsx
c:\DATA\a1 task\a1 z task\a1 box\a1 b2 new\sheet.xlsx

I only want the filenames of the files with the following constraints:

Home directory is c:\DATA
The first subdirectory having info in the name.
The second subdirectory having information in the name
The third subdirectory having box in the name
The fourth subdirectory having NEW

I have tried

File/Directory  Wildcard (RegExp)   Exclude wildcard               Required Include subfolders
C:\DATA\        .*.info\.*.information\.*.box\.*.NEW\.*.sheet.*.xlsx            N       Y
C:\DATA\        .+info\.*.information\.*.box\.*.NEW\.*.sheet.*.xlsx             N       Y
C:\DATA\        .*info\.*information\.*box\.*NEW\.*sheet.*.xlsx             N       Y

I am at a loss.
Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木格 2025-01-24 20:00:05

使用上一步中的数据,您应该发送带有这些参数的输入数据,在每行中设置目录并扩展:

示例

CREATE TABLE test(
diretory TEXT,
exten CHARACTER VARYING(15)
)

INSERT INTO testdir
(diretory, exten)
VALUES ('C:\Users\...\Documents\revision\','.*.(xlsx|XLSZ)'),
('C:\Users\...\Downloads\...\','.*.(xls|XLS)'),
('D:\...\Origen\ETA\','.*.(txt|TXT)');

和转换如下:

转换

配置步骤:

配置

和结果:

结果

我认为这对你有用

Using data from previous step, you should send input data with those parameters, in each row set the directory and exten:

EXAMPLE

CREATE TABLE test(
diretory TEXT,
exten CHARACTER VARYING(15)
)

INSERT INTO testdir
(diretory, exten)
VALUES ('C:\Users\...\Documents\revision\','.*.(xlsx|XLSZ)'),
('C:\Users\...\Downloads\...\','.*.(xls|XLS)'),
('D:\...\Origen\ETA\','.*.(txt|TXT)');

And transformation like this:

Transformation

Configuration step:

Config

And results:

Results

I think that works for you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文