How to count file columns in SSIS using C# Script

Here is the snippet which can be used to count total columns in your flat file.

Below script assume that you have column count based on separator=comma. if you use different separator then just change script accordingly

 

Posted in SSIS PowerPack and tagged , , .