Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
PraveenTechM
Contributor
Contributor

File extraction Based on DateTime format for every 5 mints

Dear Experts,

I am facing issues to extract source file which is available in <FileName>_DateTime.txt format.

Requirement:

S3(AWS) will loaded with data for every 5 mints, it has 2 files one is Tinkling file which is nothing but file is available to extract other is data file. we need to compare the datatime format with Talend Datetime and start the job execution.

Please suggest how to implement solution's using Talend(ver7.1)

Appreciate your support..

Thanks,

Praveen

Labels (3)
3 Replies
Anonymous
Not applicable

Hi

Can you show us an example of file name and what data you need to compare and extract?

 

Regards

Shong

PraveenTechM
Contributor
Contributor
Author

Hi,

My file name Conversion details:

ex : CUSTOMER_2020082841920.txt - this actual data file

TRANSFER_COMPLETED_2020082841920.txt - 0 kb file for handshake..

 

we need to compare hand shake file and pull data file for processing for ingestion..

 

Many thanks,

Anonymous
Not applicable

If you want need to extract the datatime from the file name, below are example code on tJava.

String filename = "TRANSFER_COMPLETED_2020082841920.txt";

 

String datetime=filename.substring(filename.lastIndexOf("_")+1, filename.indexOf("."));

System.out.println(datetime);

Context.datetime=datetime;

 

Then, if you need to build a new file name for comparison and extraction.

String newFileName="bababa"+context.datetime+".txt";