Wednesday, March 7, 2012

define row delimiter to fixed width files

hi all,

is there a way to define a row delimiter to fixed width files? such as this one:

1122333

4455666

7788999

in this file i have 3 columns that are fixed (col1.width = 2, col2.width = 2, col3.width = 3) but have {CR}-{LF} as the row delimiter. when i try to create a flat file connection to these kind of files- he always reads the CR-LF as part of the file text, and there is no place where i can define the row delimiter if i have.

thanks for your help!!!

Create and extra 2 byte field at the end for the import of the CR/LF and just ignore the field in your transforms.

Or use the "Ragged Right" option for the file.|||Have no idea - the work around it to add additional column of size 2 to capture CRLF.|||

What we have here is a terminology issue. The down-side of which is that fixed width files have no row-delimiters, that is not valid fixed width format. The up-side is that ragged right is exactly what you want. It has confused me a couple of times too.

As an aside you could use Fixed Width if you really wanted. You would increase your specified row length by 2, such that it includes the CR_LF if it does not already. This should be easy to see in the Columns UI. Then add an extra two character column such that it just has the CR+LF characters in. You can then ignore this column downstream, just don't use it in any transforms, especially your destination(s).

From Books Online - Format:

Delimited

Columns are separated by delimiters, specified on the Columns page.

Fixed width

Columns have a fixed width.

Ragged right

Ragged right files are files in which every column has a fixed width, except for the last column. It is delimited by the row delimiter.

No comments:

Post a Comment