Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
sum1
Contributor
Contributor

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";

 

Labels (5)
5 Replies
vapukov
Master II
Master II

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?

 

 

 

sum1
Contributor
Contributor
Author

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.


vapukov
Master II
Master II

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?

sum1
Contributor
Contributor
Author

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
vapukov
Master II
Master II

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