[Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

Reading INI file array in DTS

I've got an INI file with data similar to the following:


I need to be able to read this through DTS, and at times the number of items in the array will change.  Does anyone know how to do this?
1 Solution
Anthony PerkinsCommented:
>>and at times the number of items in the array will change<<
I am afraid to tell you that there is no concept of arrays in INI files.  As far as the INI is concerned it is not an array, just a list of items that happen to have [] brackets.  DTS will treat them exactly the same way.  In other words you can associate one Global Variable to one item.  So if the number of items is variable you may be SOL.

The only workaround, that I can think of is to use an ActiveX Script Task to read in the elements into a table.  But that defeats the whole object of using an INI file in the first place...

A better approach would be to convert the INI to an Xml document and pass that into a Stored Procedure where you can then shred it with OPENXML.
khoocAuthor Commented:
Hrmm... the requirements are already signed off, and I think the client really likes the INI idea.

oh well, time to hit the script!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now