The below link is how to load data from Multiple CSV files using For Each Loop Container:
• SSIS||Loading Multiple CSV Files with For ...
For Script Task 1 - To read Number of lines
using (var reader = new StreamReader(Dts.Variables["User::File_Path"].Value.ToString()))
{
var line = reader.ReadLine();
var Columns = line.Split(',');
int i = Columns.Length;
Dts.Variables["User::Number_Columns"].Value = i;
}
For Script Task 2 - To show the message
MessageBox.Show(Dts.Variables["User::File_Path"].Value.ToString()
" Is not a valid file. Columns are missing in this file");
En esta página del sitio puede ver el video en línea SSIS||Create validation on checking number of columns in source document using Script Task? de Duración hora minuto segunda en buena calidad , que subió el usuario SQLtoSSIStoPowerBI 10 abril 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 519 veces y le gustó 5 a los espectadores. Disfruta viendo!