Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSIS reading LF as terminator when its set as CRLF

using SSIS 2012. My flat file connection manager I have a delimited file where the row delimiter is set to CRLF, but when it processes the file, I have a text column that has an LF in it. This is causing it to read that as a row terminator causing it fail. Any ideas?

like image 965
vin Avatar asked May 24 '17 16:05

vin


People also ask

What is CR LF delimiter in SSIS?

{CR} The header row is delimited by a carriage return. {LF} The header row is delimited by a line feed.

How do I change the flat path in SSIS?

Select the connection manager in the Connection managers bar. Go to the Properties Pane and find the "expressions" option. Click the ellipsis in the adjacent blank window to open a new window. Find "File Name" or "Connection String" in the drop down, and then in the expression, put the name of your variable.


1 Answers

I have no SSIS experience but as an ETL developer I have faced this many times. So my suggestions might not help you solve the problem but hopefully point you in the right direction

  • If the problem field has text qualifier (single or double quote usually) and SSIS supports use it
  • Also if there is an option to force SSIS to use different end of record delimiter other than LF (CRLF in this case) I'd use it (hopefully there is no CRLF in the problem field text)
  • If the problem field is not the last field, you can count the number of de-limiters by reading the entire record as a single LF delimited field to identify and filter out the problem records (if they are only few) and try to stitch them back
  • If possible read the file as single record (if SSIS has an option) and replace all LF, provided CR is consistent end of record delimiter from the source
like image 89
AlwaysConfused Avatar answered Oct 14 '22 07:10

AlwaysConfused