The blog for Oracle Data Integrator ( ODI )

Getting one or several unknown files from a directory

Hi Friends…

Today I would like to share with you a way that I have been using for several years, to get unknown files from a directory in Oracle Data Integrator.

For instance, if you have files in a directory that had no controlled names but needs to be load by ODI, here there are an option:

The hole idea is based in create a file with contains all file names and read it from ODI.

(Windows example but pretty much the same at Unix/Linux)

  1. Create an ODI Procedure with a single step.
    • Source Tab
    • Technology: OS Command
    • Code:  cmd /c dir c:my_directory*.* /b /a:-d > c:my_directoryAll_Files_Names.txt
  2. Now use the technique describe at: http://odiexperts.com/?p=273 to read each line at time  using the All_Files_Names.txt as source.

So simple like that… all you need to do is, before go to the next line (loop) use the variable in the way that you want!

An example is use it as name for a datastore that is used as source in an interface, than you can call the interface once to each variable value allowing to load all files from that directory.

I hope this technique could help you guys…

Best Regards,

Cezar Santos


Leave a Reply

Required fields are marked *.

This site uses Akismet to reduce spam. Learn how your comment data is processed.