使用foreach循环遍历文件,将完整文件路径保存为变量名。
使用脚本任务来确定文件是用于手机还是普通手机。注意:文件路径也可能是foreach循环中的变量
string readingLine;
Using(System.IO.StreamReader readingFile = new System.IO.StreamReader(filePath))
{
readingLine = readingFile.ReadLine();
}
if(readingLine.Contains("Cell") //It would be best to use the full column name with a comma to avoid names with Cell in it to false trigger a true result
{
Dts.Variables("PhoneType").Value = "Cell";
{
else
{
Dts.Variables("PhoneType").Value = "Phone";
}
添加数据流
完成此操作后,您可以为所需的输出创建视图。
您也可以根据变量有条件地拆分以加载到不同的表,但是我认为这不是最好的解决方案