if the source file formats are changing intermittently , this mostly happens when the file is copied from a unix or macintosh to a windows system through FTP. if the FTP program is using an binary option then it wont change , but if you still facing the problem with different formats with the line feed charecters as below
crlf - windows
lf - unix
cr - macintosh
so when you devlop a package using lf as a row delimitor then your package might fail or give some problem when the formats got changed.
below are the steps to convert all the format types in all the files to a one specific format.
if you are looping through the files using "for each loop container"
add a script task before the dataflow and add this code
Note : below component will change all the charecters (line feed) in the text file with the new one , so make sure if you are importing any text file which has these charecters inside text.
Imports System.IO -- keep this at the first line ' Add your code here Dim file As New System.IO.StreamReader(Dts.Variables("User::vFileName").Value.ToString()) Dim writer As New System.IO.StreamWriter(Dts.Variables("User::vFileName").Value.ToString(), False) Dts.TaskResult = ScriptResults.Success ' |
No comments:
Post a Comment