#1 2012-03-27 17:27:17

lshannon
Member
Registered: 2011-01-20
Posts: 24

Iterating through files

I have a job right now that loads three CSV files into a DB and then run a series of jobs against that to build out a data warehouse. In the future there may be as many as 5 or 10.

Right now I have a separate job running for each CSV file. What I would like is a single job that goes through a folder running on each CSV that it finds. Does someone have a sample on this?

Thanks,

Luke

Offline

#2 2012-03-27 20:37:50

BRM
Member
Registered: 2011-05-23
Posts: 11

Re: Iterating through files

The component you want is tFileList.  In that component you can specify a file mask and hook the iterate output to the rest of your processing.

Offline

#3 2012-04-08 21:33:29

lshannon
Member
Registered: 2011-01-20
Posts: 24

Re: Iterating through files

Hi, does anyone know if there is a way I can pass the output from tFileList into a tRunJob component?

Offline

#4 2012-04-08 21:53:02

lshannon
Member
Registered: 2011-01-20
Posts: 24

Re: Iterating through files

Ah, looks like you can add a context variable in the job, then set it as a parameter to the tRunJob and then pass this through an iteration between the tFileList and tRunJob:

((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

Offline

#5 2012-05-04 11:47:54

geuder
Member
Company: Mojang
Registered: 2011-10-19
Posts: 91
Website

Re: Iterating through files

I've set up a cron job that pulls AppStore Sales reports to a folder,
which I then let a reoccurring Talend job:
looking in, pulling out files, extracting, loading into a staging table, moves the used files.


-- Update --
Hmm, can't see the files I uploaded...

Last edited by geuder (2012-05-04 11:50:43)

Offline

Board footer

Powered by FluxBB