Retrieve modification date of a file

Six Stars

Retrieve modification date of a file

Hi,

 

I'm trying to retrieve modification date of a file inside an archived file.

So first I put a tFileUnarchive component

Then I've tried to get the using native variable but I' ve not found the correct variable name :

 

((String)globalMap.get("tFileUnarchive_1_CURRENT_FILEDATE"))

((String)globalMap.get("tFileUnarchive_1_CURRENT_FILETIME"))

 

Both don't work.

 

I've also tried a tFileProperties component to retrieve the mtime column (and also the mtime_string column)

But I dont' know how to put these values in a tMap component in order to write it in tFileOutputDelimited component (the goal is to create a csv file in output with the inside archive file modification time in it)

 

Any idea ?

 

Thx


Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: Retrieve modification date of a file

Just connect the tFileProperties component to the tMap then map the fields you want to the output and finally, connect the tMap to the tFileOutputDelimited


TRF
Highlighted
Six Stars

Re: Retrieve modification date of a file

Ok it was a bug. I close the job. Then I add a tLogRow to see values and then relink with tFileOutputDelimited and now it works !

Thx !


All Replies
Fifteen Stars TRF
Fifteen Stars

Re: Retrieve modification date of a file

Look at tFileProperties component for that


TRF
Six Stars

Re: Retrieve modification date of a file

"I've also tried a tFileProperties component to retrieve the mtime column (and also the mtime_string column)

But I dont' know how to put these values in a tMap component in order to write it in tFileOutputDelimited component (the goal is to create a csv file in output with the inside archive file modification time in it)"
Fifteen Stars TRF
Fifteen Stars

Re: Retrieve modification date of a file

Just connect the tFileProperties component to the tMap then map the fields you want to the output and finally, connect the tMap to the tFileOutputDelimited


TRF
Fifteen Stars TRF
Fifteen Stars

Re: Retrieve modification date of a file

Did this help?

If so, thank's to mark this case as solved (Kudos also accepted).


TRF
Six Stars

Re: Retrieve modification date of a file

Hi,

 

Unfortunately it does not work

 

So here is my job :

- tFileProperties component with provided working input filepath

- tMap component with links between input columns (abs_path, dirname, basename, mode_string, size, mtime and mtime_string) and output columns (same names)

- tFileOutputDelimited component with provided working output filepath (all other properties are set with default values)

 

When I run the job, and output file is generated but it only contains semicolons (Smiley Wink

Highlighted
Six Stars

Re: Retrieve modification date of a file

Ok it was a bug. I close the job. Then I add a tLogRow to see values and then relink with tFileOutputDelimited and now it works !

Thx !

Fifteen Stars TRF
Fifteen Stars

Re: Retrieve modification date of a file

Great!

Thank's to mark your case as solved (as it is now).


TRF
Fifteen Stars TRF
Fifteen Stars

Re: Retrieve modification date of a file

@nheurtevin, not very fairplay to accept your solution when it has been given by someone else!!!

@nheurtevin thank's for the change Smiley Wink


TRF
Six Stars

Re: Retrieve modification date of a file

Sorry, I thought I had selected your solution.

Is it ok now ?

Fifteen Stars TRF
Fifteen Stars

Re: Retrieve modification date of a file

Yes, thank you

TRF

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

Downloads and Trials

Test drive Talend's enterprise products.

Downloads