how to trim dynamic File name for excel sheet name

Seven Stars RAJ
Seven Stars

how to trim dynamic File name for excel sheet name

Hi talend folks,

 

                I know how to generate dynamic File name for excel sheet name using talend. Now i want to know how to trim dynamic File name for sheet name. I need specific character only for excel sheet name. 

 

example :

my excel file name : abcd_20180530_1020

need output for excel sheet name: abcd_20180530

 

Kindly share your information. 

Thanks
RAJ

Accepted Solutions
Forteen Stars TRF
Forteen Stars

Re: how to trim dynamic File name for excel sheet name

Assume the Excel filename is in the global variable called "filename", you can do:

((String)globalMap.get("filename")).substring(0, 13)

TRF

All Replies
Forteen Stars TRF
Forteen Stars

Re: how to trim dynamic File name for excel sheet name

Assume the Excel filename is in the global variable called "filename", you can do:

((String)globalMap.get("filename")).substring(0, 13)

TRF