generate output file (csv)

Seven Stars

generate output file (csv)

Hi All,

I have a requirement wherein the name of the output file shud be dynamic as below (The data is extracted from DB table)

XXX_YYYYMMDDHHNNSS.csv

 

Also it contains header in format below

#DATA;XXXXXX ;<YYYYMMDD<HHNNSS>>

 

 and footer in below format

#END;No_of_reecords

 

Note: The file will also contain the data with 15 columns which will be placed after header and closed by footer.

Can you please suggest possible design to do so

Thanks

Ten Stars

Re: generate output file (csv)

Is the timestamp based on the system time or from another source?
Moderator

Re: generate output file (csv)

Hello,

Do you want to load all the tables into csv. files dynamically?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Seven Stars

Re: generate output file (csv)

Its based on system time
Seven Stars

Re: generate output file (csv)

There is only one table of 15 columns whose data has to be extracted in csv file
Data from all columns needs to be extracted
Ten Stars

Re: generate output file (csv)

At the start of most of my jobs, I use a tSetGlobalVar component to setup some commonly used variables.  One of them in the current timestamp, unsurprisingly named "timestamp", which I create with the expression:
TalendDate.getDate("yyyyMMddHHmmss")

 

You can use global variables created this way in most expressions and component settings.  For an output file, you would set the file name to be "XXX_" + ((String)globalMap.get("timestamp")) + ".csv"

 

Six Stars

Re: generate output file (csv)

That's what I would suggest too.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download