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