cancel
Showing results for 
Search instead for 
Did you mean: 

How to Specify Regular Expression in Excel Source File Name

Former Member
0 Kudos

Hi,

I want to load one or more Excel files from a folder into a table. The files could be of .xls or .xlsx extension.

So, in the file format, I need to specify the file name for taking both .xls and .xlsx files only for loading.

Currently I'm specifying it using wildcard as *.xls* . But, is there any other way so that i can keep it more specific.

Can we use regular expressions other than the basic wild cards here? Expecting your valuable suggestions.

Thanks,

Dav

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member211387
Contributor
0 Kudos

if it is only xls and xlsx files you are getting in that specific folder location, then you can even use *.*. This is a risky option because if you have any other file in that folder, Data Services will try to read it too.

The option from Dirk will be ideal for specific files.

If you don't want to hard code the pattern, you can use parameter by either declaring a variable or substitution parameter.

kind regards

Raghu

former_member198401
Active Contributor
0 Kudos

Better to use a Global Variable like

# Set the default path to be used for target file VBAK

$G_File_Name='/usr/test/sap/VBAK*.xlsx'

Initialize the above global variable so that you dont need to manually enter the file name with extension.

Regards

Arun Sasi

former_member187605
Active Contributor
0 Kudos

You can combine wildcards and commas. E.g.:

     VBAK*.xlsx,VBAK*.xls

will process files as VBAK20160401.xlsx, VBAK20160402.xls, VBAK20160403.xls... together in one run.