0
votes

I have .csv delimited file and Flat File Connection Manager to this file.

If I understand right Flat File Connection Manager parse .csv file, creates columns and pass them to external columns of Source Component.

Question is how can I get values from external columns when creating custom Source Component. Is it even possible?

Thanks and sry for my bad english.

1
You should work through the Microsoft custom source component developer guide, try it and when you have a problem post code and a specific answer. As an example in your custom source component, to get the columns from a CSV file you could simply open it as a text file, capture the first line and load that into the appropriate collection.Nick.McDermaid

1 Answers

0
votes

You understand correctly that the flat file connection manager parses .csv files, and creates columns in your (flat file) source component.

To add 'external' columns to this data stream, you simply add a derived column after the flat file source, and add whatever you need.

Where your question becomes ambiguous is when you refer to a 'custom source'. If you're using a flat file connection manager, you need to use a flat file source. But if this is inadequate for your purposes, eg you need to read a flat file with a different number of columns on each row, you could use a script component as your source. This is a 'custom' source in that you code in the rules for each output column yourself.

Either way, the answer to 'how do I add external columns' is the same - add a derived column after the source and use this to add them in.