Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
Hi maybe you can use the global Var created by the tFileExist : (String)globalMap.get("tFileExist_1_FILENAME").
Send me love and kudos
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