Changing
Line Endings
UNIX, Windows, and Mac OS use different characters to denote
the end of a line in a text file. Project Builder can open text
files that use any of these line endings, and, by default, preserves
line endings when it saves text files. However, other utilities
and editors may require that a text file use specific line ending characters.
To change a file's line endings:
- Choose Format > Line Endings and select Use
Unix Line Endings (LF), Use Mac Line Endings (CR), or Use Windows
Line Endings (CRLF).
To choose the default line endings for new files:
- Choose Application > Preferences, click Editing,
and change the New Files setting.
To change a file's line endings when it's saved:
- Choose Application > Preferences, click Editing,
and change the Saving setting to Unix (LF), Mac (CR), or Windows
(CRLF).
To preserve a file's line endings when it's saved:
- Choose Application > Preferences, click Editing,
and change the Saving setting to Preserve.
Generally, you won't need to worry about line endings. Here
are some guidelines to keep in mind when deciding which line endings to
use:
- Most Mac OS development applications, including
CodeWarrior and BBEdit, can handle files that use UNIX, Mac OS,
or Windows line endings. MPW, however, can handle only those files
with Mac OS line endings.
- Many BSD command-line utilities, such as grep and awk, can handle
only those files with UNIX line endings
- Simple Text properly displays only those files with Mac OS
line endings.