Differences between CR and LF

{CR} represents the Carriage Return; {LF} represents the Line Feed.

Line Feed – LF – \n – 0x0a – 10 (decimal)

Carriage Return – CR – \r – 0x0D – 13 (decimal)

Different operating systems have a different way of representing the new line.

Mac Operating System understands ‘\r’ as new line.

Unix and Linux Operating Systems understands ‘\n’ as new line character.

Windows Operating System needs both the characters together to interpret as new line, which is ‘\r\n’.

This is the reason why a file created in one OS does not open properly in another OS.

Below is an example for using the ‘\r’ and ‘\n’ using SQL Server:

A Flat File connection manager enables a package to access data in a flat file. For example, the Flat File sources and destinations can use Flat File connection managers to extract and load data.

When you add a Flat File connection manager to a package, SQL Server Integration Services creates a connection manager that will resolve to a Flat File connection at run time, sets the Flat File connection properties, and adds the Flat File connection manager to the Connections collection of the package.

You can configure the Flat File connection manager in the following ways:

Specify the file, locale, and code page to use. The locale is used to interpret locale-sensitive data such as dates, and the code page is used to convert string data to Unicode.

Specify the file format. You can use a delimited, fixed width, or ragged right format.

Specify a header row, data row, and column delimiters. Column delimiters can be set at the file level and overwritten at the column level.

Indicate whether the first row in the file contains column names.

Specify a text qualifier character. Each column can be configured to recognize a text qualifier.

Set properties such as the name, data type, and maximum width on individual columns.

In General Page, we can see the option for Header row delimiter, select the list of delimiters for header rows, or enter the delimiter text:

Leave a comment

1 Comment

  1. Devender

     /  April 15, 2011

    It is very helpful info..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

  • Recent Posts

    • 450,714 hits
  • Join 37 other followers

  • Archives

  • Categories

  • April 2011
    M T W T F S S
    « Mar   May »
  • Advertisements
%d bloggers like this: