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)
- 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
- 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…
Leave a reply →