Just Great Software

EditPad - Convenient, powerful and versatile text editor to edit all kinds of text files

 Introduction 

 

 Buy Now 

 Our Guarantee 

 Download 

 Testimonials 

 Contact Us 

 

 Features & Benefits 

 Clip Collections 

 Syntax Coloring 

 File Navigation 

 Spell Checker 

 Search & Replace 

 Unicode 

 Running Tools 

 Hexadecimal Mode 

 Tips & Tricks 

 Programmer or Not 

 Many File Types 

 Fully Configurable 

 Portable Editor 

 Get Fonts 

 Screen Shots 

 Linux 

 Languages 

 

 Version History 

 Newsletter 

 Affiliates 

 

 Free EditPad Lite 

 Comparison 

 

 EditPad Classic 

 

 

 

Ace Text - Store, manage, edit and reuse text from a central location
Regex Buddy - Learn, create, understand, test, use and store regular expressions
Regular Expressions Complete Tutorial and Reference
PowerGREP - Find files and information or search and replace through files and folders
HelpScribble - Full-featured help authoring tool for creating help files from start to finish
DeployMaster - Installation builder delivering your software with a good first impression
      

Be More Productive with Your Favorite Text Editor

EditPad Pro Tips and Tricks

Line Breaks in Windows, UNIX & Macintosh
Text Files

A problem that often bites people working with different platforms, such as a PC running Windows and a web server running Linux, is the different character codes used to terminate lines in text files.

Windows, and DOS before it, uses a pair of CR and LF characters to terminate lines. UNIX (Including Linux and FreeBSD) uses an LF character only. The Apple Macintosh, finally, uses a CR character only. In other words: a complete mess.

Problems arise when transferring text files between different operating systems and using software that is not smart enough to detect the line break style used by a file. E.g. if you open a UNIX file in Microsoft Notepad, it will display the text as if the file contained no line breaks at all. If you open a Windows file in a UNIX editor like "joe" or "vi", you will see a control character (the CR) at the end of each line. Older versions of Perl on Linux would refuse to run any script that used Windows line breaks, aborting with an unhelpful error message.

Mix All Line Break Styles

EditPad Pro does not care which line break style a file uses. It will automatically detect the format and indicate it in the status bar. If you open a Mac file on your Windows PC, it will still be a Mac file when you save it. To change the line break format, select the Windows, UNIX or Mac option in the Convert menu.

EditPad Pro can even handle files that use inconsistent line breaks. This is indicated in the status bar as (Mixed) along with the dominant style. In such a situation, it's best to make the line break style consistent. Very few applications can properly handle files with mixed line break styles. Simply select the line break style you want (Windows, UNIX, Mac) from EditPad Pro's Convert menu.

Transferring Text Files Between Computers
Using Different Operating Systems

A common way to transfer files between a computer and a server is FTP. All FTP software can transfer files in "ascii" or "binary" mode. In "ascii" mode, the FTP software will convert line breaks, while in "binary" mode it will not. In "ascii" mode, transferring a Windows file from a Windows PC to a Linux server results in a UNIX file on the server. Downloading the file again converts it back to Windows. This system works perfectly if you remember to turn on "ascii" mode for text files. Many FTP clients also have an "automatic" mode that switches between ascii and binary depending on the extension of the file you're transferring.

Things go wrong when mixing "ascii" and "binary" transfers. When a webmaster uploads a Windows file to a Linux server in "binary" mode, the file has CR LF line breaks on the server. If you then download that file with your web browser on your Windows PC (which does the UNIX->Windows conversion), the browser will interpret the file on the server as a UNIX file, even though it is in Windows format. It will convert each LF into CR LF, resulting in a file that uses CR CR LF as line breaks.

If you try to open that file, you'll get quite different results with various software. Microsoft Notepad will interpret the CR CR LF as a single line break. EditPad however, since it supports mixed line break styles, will interpret it as a double line break. First a CR (Mac style), and then a CR LF (Windows style). The file will appear double spaced in EditPad Pro.

To remove the unwanted blank lines, simply select Double->Single spaced in EditPad Pro's Convert menu.

      
Only US$ 49.95
Windows 98, ME, NT4, 2000, XP and Vista
100% satisfied or money back
free trial download

 

 

Page URL: http://www.editpadpro.com/tricklinebreak.html
Page last updated: 12 June 2008
Site last updated: 11 August 2008

Published by Just Great Software Co. Ltd.
Copyright © 2000-2008 Jan Goyvaerts.
All rights reserved.