Editing a file using C# or VB
Posted on 2014-02-03
Dear Microsoft Visual C# 2008 and Microsoft Visual Basic 2008Experts;
I need to edit a .CSV file using the Script Task within SSIS 2008. The file will be comma delimited (,) or carrot delimited (^), text qualifier is a quote (“), header row delimiter is a line feed (LF) and column names in the first data row. Searching though the file there is a common pattern of strings that needs replacing; examples inside the square brackets would be [“”)] replaced with [)], [“”.] replaced with [.], [ “,””] replaced with [“,”] and [\r\n] replaced with a blank space.
I have seen examples of .vbs scripts using replacement like;
if !foo!==ex3 set foo=ex5
If InStr(strLine,""")")> 0 Then
strLine = Replace(strLine,""")",")")
I need something to go within the Script Task in SSIS 2008.