Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] unable to count file row count

Hello,
I have a job which captures all details of the files in a particular folder.Like file_rowcount , size or file_name,
But i am unable to capture file_rowcount
Please see my job designe:-

0683p000009MCUq.png

tfilelist:-
0683p000009MChq.png
tfileproperties:

0683p000009MChq.png
tfilerowcount:-
0683p000009MCnW.png
tmap:
0683p000009MCpl.png
the output i am getting correct except count is not matching with the file , its giving any random xyz figure.
Please help here
Thanks.
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi 
It is a job design issue, the global variable should be used after component, it should be:
tfilelist--iterate--tfilerowcount--oncomponent--tfileproperties--main--tmap.....
Regards
Shong

View solution in original post

12 Replies
Anonymous
Not applicable
Author

Hi 
It is a job design issue, the global variable should be used after component, it should be:
tfilelist--iterate--tfilerowcount--oncomponent--tfileproperties--main--tmap.....
Regards
Shong
Anonymous
Not applicable
Author

Dear Shong,
Thanks for reply,
i just did what you said , same issue , row-count coming incorrect , even if file has only header , its giving count as 44.
0683p000009MCZF.png
All logic is same. just shifter the positions as suggested by you.
but same issue, even file has no records still it shows any random figure.
Anonymous
Not applicable
Author

Dear Shong,
Its resolved,
row separator for tfilelist was wrong , default should have been "\n".
Thanks.
Anonymous
Not applicable
Author

Great, thanks for your feedback!
Anonymous
Not applicable
Author

Dear Shong,
In this job , if there are 10 files in the directory , how will i find the count of files in the same job ?
any global variable function ?
Can you suggest?
Thanks
Anonymous
Not applicable
Author

Hi ,
You can do it ,it is  pretty simple .
tfilelist > tfileinputdelimited>tmap > tfileout >tjava
In tjava component , you can use the global variable ,which will help you to print the filename and row count of file ,which is being processed by tfilelist.Below are the screenshots for the same.
0683p000009MCpq.png
0683p000009MCcP.png
Anonymous
Not applicable
Author

Dear Harkirat,
Thanks for reply , i want to include the logoc in the same job which i made it , please have a look at it above screen shots are attached
Anonymous
Not applicable
Author

Hi ,
You can do it ,it is  pretty simple .
tfilelist > tfileinputdelimited>tmap > tfileout >tjava
In tjava component , you can use the global variable ,which will help you to print the filename and row count of file ,which is being processed by tfilelist.Below are the screenshots for the same.
195095/mini_blob_20170104-0939.png
195095/mini_blob_20170104-0940.png

i need to find the file count not the file row count 
Anonymous
Not applicable
Author

Dear Shong,
In this job , if there are 10 files in the directory , how will i find the count of files in the same job ?
any global variable function ?
Can you suggest?
Thanks

Dear Shong,
How can i find the total files in a particular folder?
In the same job i want to find the total files , can you suggest please?