Skip to Content
avatar image
Former Member

How to Specify Regular Expression in Excel Source File Name

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Apr 08, 2016 at 10:57 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 11, 2016 at 08:13 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 11, 2016 at 12:32 PM

    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

    Add comment
    10|10000 characters needed characters exceeded