Today I got a query asking me if we can have a script component which reads data from a text file which is supposed to have 5 input columns. However the data that they receive has at time extra columns or less columns for certain records. So the question arises how do we go about this.
Input:
1.Col1,Col2,Col3,Col4,Col52.1,2,3,4,53.1,2,3,4,5,6,7,4.1,2,31.Col4 Col3 Col2 Col1 Col2.5 4 3 2 13.5 4 3 2 14.NULL NULL 3 2 1- Script Component
- Flat file source which reads all data into one column and then splits them based on index of the comma in a derived column
- Flat file source with delimited settings to read just 5 columns.
No comments:
Post a Comment
Thanks for your valuable comment!!