c# - How to Parse text file using SSIS Script Component with Complex and Varied Data -
i have text file holds data based on series of tags. tag represents column crlf delimiter, tag b separate column semi-colon delimiter, , tag c contains values delimited under scores , crlf delimiters. i've created c# script component output columns each tag.
sample data each tag:
tag varchar(10) a123456789 tagb varchar (50) cdw5w3464353 tag c varchar(max) ***;user_____date______value;user123_____6/3/15_____3366cde; do use regex identification of each tag value? or there way handle scenario? note tags repeat each entry loaded sql server destination. also, note of tags needed, extraneous text values in records can disregarded.
i try keep script component simple possible - splitting input rows separate text files, perhaps adding row numbers or similar keep track of sets of rows. use strings.split chop each tag c row separate columns, e.g. date values go in column #2, single heading row showing "date" in column #2.
then use ssis flat file source component (in subsequent data flow task) load data separate text files. data flow can ignore unwanted columns.
Comments
Post a Comment