SSIS and Ini File Import Question -
05-09-2006
, 01:45 PM
Hi,
I am a new SSWUG full member, making my first forum post.
I have to import 2250 *.ini files into a SQL2005 table. Each *.ini file's
header section provides one row of data for the target table.
Currently, I use a Foreach container in SSIS, and loop through the list of
files. On each iteration of the loop, I perform a "source flat file
connection", and each line in the *.ini file is dropped into a column (the
entire line i.e. 'MachineNumber = 2234', becomes the contents of a field).
This method is not the best method, as I am treating an *.ini file like a
flat file, and I do a lot of string parsing after the import to remove the
unnessecary text (i.e. remove 'MachineNumber = ' in the above example). Also,
some text files are very large (190KB), and the remaining text in the file,
after the first four *.ini file values, end up stuffing into a fifth column.
If too much data tries to stuff into the fifth column (i.e. 189KB of the
190KB), the SSIS processing fails, since the fifth column only allows 8000
characters max. The failure occurs even when I set the flat file connection
to a text datatype, and don't drop the column into the destination table.
SSIS complains on the read attempt of the file, when it can't fit the
remaining text into the fifth field.
Is there a better parser available through SQL2005 SSIS, which allows me to
retrieve specific values from specific sections in *.ini file? Or should I do
something outside SSIS to accomplish this?
--
Kevin Harmer MCDBA, MCSE, MCT
360 Data Solutions |