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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jmialoundama
Specialist
Specialist

Get name tFileInputExcel

Hi,

I developed this job and want to retrieve the name of the excel file as the output name of my CSV file.

I tried to go through a context variable in which I put:

FILE_INPUT_EXCEL = /doc/input/test.xlsx

So I want my CSV file to be called test.csv

How could I do this?

I know I can go through the tFileList component but I don't have a list of files to process.

thanks in advance

Labels (4)
3 Replies
Anonymous
Not applicable

If you have a context variable which stores the file path like "/doc/input/test.xlsx", then you can extract the file name from this variable.

context.filepath.substring(context.filepath.lastIndexOf("/")+1)

 

Regards

Shong

gjeremy1617088143
Master
Master

Hi maybe you can use the global Var created by the tFileExist : (String)globalMap.get("tFileExist_1_FILENAME").

Send me love and kudos

 

Anonymous
Not applicable

Hello,

You can use tFileList componen even if you have only one excel file.

 ((String)globalMap.get("tFileList_1_CURRENT_FILE")) is a variable created by the tFileList component for each file it found.

Best regards

Sabrina