Skip navigation
Contact Us
1658 Views 5 Replies Latest reply: Nov 8, 2012 9:42 PM by Thom Biernat RSS
shiva jalabagari Novice 21 posts since
Jul 6, 2011
Currently Being Moderated

Nov 8, 2012 4:27 AM

Pick up Latest file from Unix box thorough Informatica

Hi All,

 

My requirement is to pick up latest XML file from Unix box using Informatica.(name will be different from every time load)

 

Ex:

 

  • •1) File will be placed in Unix box every 4 hours with a new name (there are lots of other files also available in the folder)
  • •2) I created FTP connection for my source and able to connect and process if i specify file name (remote file name)which file to process it.
  • below is the screenshot of it
  • Capture1.PNG

 

 

 

Requirement: Need to pick up latest file every time and process it as i need to schedule to run my WF 4times a day.

 

Solution: 1) By saying i have N number of solutions in my mind .But at the time of implementation i am not able to create single solution to pick up this.

 

Can any one help me on this will be highly appreciated

  • Thom Biernat Newbie 4 posts since
    Jan 31, 2004

    Use a filelist - In your session...use a PRE-SESSION command to pick the latest file file by sorting and writing the latest file to your filelist

     

    ls $PMSourceFileDir/filename*|tail -1 > $PMSourceFileDir/FILELIST.LST

    • Sri 1236 Apprentice 265 posts since
      Mar 21, 2011

      Thom's idea sounds simple and should work.  Is the source file coming into ftp server would have a particular fixed pattern in name or the name is generated dynamically. ?

       

      If the src file have a fixed name pattern, then you can use Thom's syntax,other wise, if the name of src file is generated randomly, then you can use somtehing similar to " ls -ltr | tail -1 " to find the most latest file in the src folder.

       

      Hope this gives you some idea.

       

      Thanks.

      • Thom Biernat Newbie 4 posts since
        Jan 31, 2004

        you can always create a unix shell script that will FTP and get the files...sort them and create a filelist for you.  All done without informatica. This can be tested beforehand.  Once you have a filelist containing the file you want to process..you can run your session.

         

        You then can call this unix script using a cmd task , then you can run your session.

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points