Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Rathesh
Contributor
Contributor

Fetching the file with space in filename

I want to load an excel file to database.Source File name will be like Test08232018.xlsx. Name of the file followed by current date. Sometimes there will be space between Filename and data. Job has to fetch fetch the file correctly even if it having space or not having the space.

Labels (2)
11 Replies
fdenis
Master
Master

where is your problem?
fileName can contain space.
iamabhishek
Creator III
Creator III

Do you want a regular expression sort of functionality to search for your files which matches your criteria and then load to database?
Rathesh
Contributor
Contributor
Author

yes. but how to implement regular expression in the file path.

Rathesh
Contributor
Contributor
Author

Sometimes file name contains space between name and date and sometimes it won't

fdenis
Master
Master

use tFileList, to list all files
then use Iterate on TFileInputExcel to load each file into db.
Use (String)globalMap.get("tFileList1_CURRENTFILEPATH") as fileName.
Regards
Rathesh
Contributor
Contributor
Author

I have two Excel files with different schema. Both of them has tobe loaded
into separate tables.
Eg:
First file name - TestReport08232018.xlsx
Second file name - Test08232018.xlsx

For loading first file, i am using tFileList.
Inside tFileInputExcel in path, I put filepath+"Test
report"+Talenddate.getDate("MMddyyyy")+".xlsx"

But how to load the second file. How to give path.sometimes space will come
between Test and date.
iamabhishek
Creator III
Creator III

A regular expression match like this -

"Test(.*)"

would make sure that you are fetching all the files start with Test

Rathesh
Contributor
Contributor
Author

Regular expression for space is \s. I already tried (\s*). I am receiving
an error like invalid escape character.
iamabhishek
Creator III
Creator III

You need to use - (\\s*)