Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
smore1665386696
Contributor II
Contributor II

How to read date from TXT file?

How to read date from TXT file in talend job, dates can be changed whenever the user wants. Date format is like 23_2_2023. And also save files from input before and after changes in file name as a back up using tfile copy .

3 Replies
Anonymous
Not applicable

Hi

Using tFileInputDelimited to read a txt file, select 'Date' type for the date column on the schema and set the date pattern as "dd_M_yyyy".

 

Regards

Shong

smore1665386696
Contributor II
Contributor II
Author

But we are using tcontext component for how to do it further

 

Anonymous
Not applicable

Using tContextLoad to load the values of context variables? If so, you can only read the data as a string from TXT file, if you need to use the value as a Date, you can convert the string to a Date with the below expression:

TalendDate.parseDate("dd_M_yyyy", context.varName)