Discussion:
Lookup from a CSV File
(too old to reply)
r***@gmail.com
2020-04-23 12:18:27 UTC
Permalink
Hi Group!

We use the TDI in a bundled Software Environment and do simple queries with it.
We have already add a lookup database connector,to enrich the data with additional informations.

Now I would like to do the same thing with a csv File, but the File Connector doesn't provide the lookup mode.

How can I made a lookup from a File?

Thanks for your help!
Robert
Eddie Hartman
2020-04-23 17:45:40 UTC
Permalink
The File Connector only supports AddOnly and Iterator modes. However, ours pretty simple to script your own in order to support random access, like Lookup. Let me know of you’d like guidance on this.

/Eddie
r***@gmail.com
2020-04-23 19:59:29 UTC
Permalink
Hi Eddie!

Thanks for your answer!
If there is a documentation out there, it would be nice to share the link or how have you made it?

Regards
Robert
Eddie Hartman
2020-04-25 17:20:45 UTC
Permalink
Post by r***@gmail.com
Hi Eddie!
Thanks for your answer!
If there is a documentation out there, it would be nice to share the link or how have you made it?
Regards
Robert
Have a look here, Robert:

https://www.ibm.com/support/knowledgecenter/SSCQGF_7.1.1/com.ibm.IBMDI.doc_7.1.1/referenceguide58.htm#scriptconnect

And it also refers to the TDI_install_dir/examples/script_connector directory of your IBM® Tivoli Directory Integrator installation for a sample to look at. Your Connector will read in the entire file, for example in the initialize() function, store the data in memory. For example, I would probably create an Array of JavaScript objects, each one with a property for each field name in the CSV, and with the value for that line in the file. Then it should be simple to implement a findEntry() function so that you can look up field values.

I coach this stuff all the time, and if you are interested then please let me know.

/Eddie

Loading...