tFTPFileList and Regular Expressions

Highlighted
Five Stars

tFTPFileList and Regular Expressions

Trying to use regular expressions (RE) with the tFTPFileList component.

The RE is   ^((?!BAMTiming30D|BAMCensus).)*.csv

 

If I just use a file mask of *.csv all of the csv files are listed.

 

I know the RE is correct because I use it with tFileList and I get the proper list of files.

 

Reading the documentation for tFTPFileList is says:

Filemask: enter the filename or filemask using wildcharacters (*) or regular expressions.

 

So RE is supported, but I cannot get it to work.

 

Using 6.4.1 Enterprise.

Thank for the help

Peter

 

 

Highlighted
Moderator

Re: tFTPFileList and Regular Expressions

Hello,

Is there any error Info printed on console when you use regular expressions (RE) ^((?!BAMTiming30D|BAMCensus).)*.csv in tFTPFileList? Do you get same result by using tFTPGet?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted
Five Stars

Re: tFTPFileList and Regular Expressions

Hi Peter,

 

you can use below link to check whether your regular expression is correct or not .

www.debuggex.com

Also try with removing the .(dot) before the last bracket. use .* instead.

 

Let me know more about your issue.

 

Thanks,

Neha 

Neha
Highlighted
Five Stars

Re: tFTPFileList and Regular Expressions

Sabrina,

 

I doubled checked my RE and it is correct.

 

If you review the tFTPGet component there is a check box in order to select Perl 5 Regex as filemask.

No such checkbox exists for the tFTPFileList component, even though the documentation states that tFTPFileList supports Regex.

 

I have worked around the issue for now by adding a tJavaRow component after the tFTPFileList component to apply the appropriate Regex.

 

Peter

 

 

Highlighted
Moderator

Re: tFTPFileList and Regular Expressions

Hi,

It works perfect fine when you use tFTPGet component with Perl 5 Regex option checked?

We suppose that the regular expression does not work with Glob Expressions.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog