Skip to main content

"extra" carriage return/line feed information on files edited in Windows


Technote (FAQ)


Question

Why do I see "extra" carriage return/line feed information on files edited in Windows when they are viewed in UNIX?

Answer

Lines in text files that have been created or updated under DOS or Windows end with:

\r \n

Whereas lines in text files created or updated under UNIX end with only:

\n

\r = return (CR) octal 015
\n = new-line (NL) octal 012

If you want a file created under DOS or Windows to look good under UNIX, you can run the following command. Note: This will delete *all* the CRs from the file.

tr -d "\r" < input_dos_or_win_file > output_unix_file

Rate this page:

(0 users)Average rating

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page:


(0 users)Average rating

Add comments

Document information

AFS

AFS


Software version:
3.5, 3.6


Operating system(s):
Windows 2000, Windows NT


Software edition:
All Editions


Reference #:
1044658


Modified date:
2011-11-06

Translate my page

Content navigation