tfilelist

Highlighted
Five Stars
Five Stars

tfilelist

Hi ,

i have a folder structure like 

C:\usr\region\pcode\Metrics

where 

region is region 1 , region 2 ,region 3----- 3  folders

pcode is pcode1,pcode2,pcode3,pcode4 - 4 folders

Metrics is  M1,M2,M3,M4,M5,M6 -----

in M folders i have "*.json"  files to be merged.

 

also merged files should be stored in another location for processing.

Can anybody look into this

currently i am able to merge with this below flow:

tFileList -> tJava -> tFileInputFullRow -> tFileOutputDelimited(outputfile)

using the following logic in tJava:

outputfile =((String)globalMap.get("tFileList_3_CURRENT_FILEDIRECTORY"))+"\\"+((String)globalMap.get("tFileList_3_CURRENT_FILEDIRECTORY")).substring(((String)globalMap.get("tFileList_3_CURRENT_FILEDIRECTORY")).lastIndexOf("\\"),((String)globalMap.get("tFileList_3_CURRENT_FILEDIRECTORY")).length())+".json";

 

Highlighted
Forteen Stars

Re: tfilelist

Hi,

 

 

welcome to the community!

 

could you clarify your goals?

 

you have 3 levels of folders, do you want to merge many files in each C:\usr\region\pcode\Metrics to the single output file:

- per region and pcode and pmetric - total 3 x 4 x 6 = 48 output files?

 

 

 

-----------
Highlighted
Five Stars
Five Stars

Re: tfilelist

Hi ,Thanks for the reply.
I just want
Per one metric file for M1 to 6.
Only Six files, at different location, as per my logic it's storing in same folder Metric.As input1,Input2 and merged fileAnd path also should be extracted , for each metric file to be inserted.


Forteen Stars

Re: tfilelist

from 3 region, each of them contain 4 pcode folder, and each of pcode contain 6 metrics

 

you want to merge:

- files from 12 folders (all) for metric 1 to single file metric1.json

- files from 12 folders (all) for metric 6 to single file metric6.json

 

correct?

-----------
Highlighted
Five Stars
Five Stars

Re: tfilelist

No

The confusion is , only Metrics folder has files.
No other folder contain files.So only one file per region\pcode\metric1. Etc
Another thing is I need filepath information to be extracted.

Regards,Sum
Highlighted
Forteen Stars

Re: tfilelist

you have 3 regions

 

c:\usr\region1\pcode1\metric1

c:\usr\region1\pcode2\metric1

c:\usr\region1\pcode3\metric1

c:\usr\region1\pcode4\metric1

c:\usr\region2\pcode1\metric1

c:\usr\region2\pcode2\metric1

c:\usr\region2\pcode3\metric1

c:\usr\region2\pcode4\metric1

c:\usr\region3\pcode1\metric1

c:\usr\region3\pcode2\metric1

c:\usr\region3\pcode3\metric1

c:\usr\region3\pcode4\metric1

 

and this is for metric1 only

 

it is based on original:

Hi ,
i have a folder structure like 
C:\usr\region\pcode\Metrics
where 
region is region 1 , region 2 ,region 3----- 3  folders
pcode is pcode1,pcode2,pcode3,pcode4 - 4 folders
Metrics is  M1,M2,M3,M4,M5,M6 -----

 

-----------

2019 GARTNER 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

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now