Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tFileList-----iterate------tFileproperties

Hi I am trying to Read a directory listing and get the properties of each file i.e. base name, md5 etc and load them to context variables. however when I am struggling to join tFilelist to tFileProperties. i get the following error (see screen shot) . The screen shot only show the output going to tLogRow for now....
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Silvio,
Not sure what is the problem you are facing, but this is something important requirement and don't see that it could be a bug...
the job is like
tFileList-->itearte-->tFileProperties-->tLogrow
- Use appropriate filter for file names or use "*" and give path of the folder
this job would provide details of all the files which matches with the filter...
Vaibhav

View solution in original post

11 Replies
Anonymous
Not applicable
Author

Hi
Welcome to Talend Community!
The screen shot is missing.
Regards,
Pedro
Anonymous
Not applicable
Author

Hi Yes I am trying to upload it , but it does not , I keep browsing and attaching ... will troubleshoot
Hi
Welcome to Talend Community!
The screen shot is missing.
Regards,
Pedro
Anonymous
Not applicable
Author

Hi
Please notice the limits: 20 images per post, each image must be less then 1024x768 pixels and 200 KB.
Regards,
Pedro
Anonymous
Not applicable
Author

attached screen shot>
more info:
error:
Syntax error on token "tFileList_1_CURRENT_FILE", , expected
Settings
tFileList:
Directory: "/etc/samba/CT/Load/"
tFileProperties:
File: "/etc/samba/CT/Load/((String)globalMap.get("tFileList_1_CURRENT_FILE"))"
when setting my file in tFileProperties to a staid file its output is good.
Anonymous
Not applicable
Author

Hi
You'd better modify the 'File' text field with this expression ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).
Regards,
Pedro
Anonymous
Not applicable
Author

Hi Pedro
thanks ... but i get the following

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error on token "tFileList_1_CURRENT_FILEPATH", , expected
Anonymous
Not applicable
Author

Seems to be working fine on my PC....
If you could upload snapshots of the properties of all components,will have a look into it.
_AnonymousUser
Specialist III
Specialist III

I have a similar problem but I actually need to add the Basename of the tFileProperties to the schema of the input file during the flow/stream. What I want to achieve is tFileList ---Iterate--->tFileProperties-------Main------>tMap------Main---->SQLTable. In the SQLTable I want to have the schema + the tFileProperties(Basename). I tried adding to a Var but I don't think these dynamically update for each Iteration or for that matter each row, but rather update only by the Job.
I have tried a tJavaRow using a (string)global.map(tfileList_1_Current_File) but that threw up some assignment to VAR error - can't remember exactly as I have tried so many I thought better stop and seek some help...!!!
Other thoughts were to read the file list first to an SQL table and then do some sort of Loop on the table to provide the filter on the tFileList but I guess would need to do an If...Else to count down the index of the file list in the SQL table but then not sure how the Else would finish the job.
Looking for an elegant solution....!!!!
Any help would be much appreciated.
Anonymous
Not applicable
Author

After feeling I may have been asking a very simple question, though my Informatica colleagues at work did not have a clear solution, I read the UG agai and noticed the parallel Iteration function and used this as below. May not be the most elegant but it seems to work. I use the SetGlobalVar as the Filename for each pass of the tFileList and then have have to LTRIM the file. I'll need to do a DateParse on the output string to reformat but I can live with that.
Be very happy if anone has a solution that can pick up the tFileProperties Basename or mtime and get the date that would be much preferred.