Facebook Twitter Instagram
    Facebook Twitter Instagram
    Techtown
    • General
    • Linux
      • Linux Commands
      • Debian
      • Ubuntu
      • Linux Mint
      • Centos
      • OpenSUSE
      • Fedora
    • Text Editors
      • Notepad++
      • Sublime Text
    • Resources
      • Books
    • Write for Us
    Techtown
    Home » Notepad++ EOL Conversion – Change line termination character
    Text Editors

    Notepad++ EOL Conversion – Change line termination character

    By SandiSeptember 9, 2021Updated:September 9, 2021No Comments2 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    The EOL conversion in Notepad++ allows you to change the line termination character in a text file. Unix uses line feed (LF), Windows use both carriage return (CR) and line feed (LF), and Macintosh uses (CR) as line termination characters.

    Let me show you how this character looks in a normal text file.

    Open the file in Notepad++. Click on View -> Show Symbol -> Show All Characters or click this “¶” menu on the toolbar to displays all the characters including CR and LF.

    What’s the problem?

    The normal text file should not have any issue as there is no difference as such. But when you are creating a file in Window and using it in Unix, it may not give a desirable result. A shell script with Windows EOL will not execute in Unix.

    The script execution fails with Command not found and Program exited with status 127 error. The happens because of an additional CR character at the end of the line which becomes CTRL M in Unix. There are ways to find this CTRL M character and remove it.

    One way is using Notepad++. You can use Notepad++ to change the line termination character. That is what I am going to show you.

    EOL Conversion in Notepad++

    Ler’ see how to change the line termination character using Notepad++. Consider the below file which is created in Windows/DOS format.

    CR LF is line termination character in Windows/DOS

    Now, Go to Edit-> EOL Conversion – > Unix(LF) to change the line termination character to Unix format. Notepad++ quickly removes CRLF and just put LF.

    LF is line termination character in Unix

    Now, Go to Edit-> EOL Conversion – > Macintosh(CR) to change the line termination character to Unix format. Notepad++ quickly removes LF and just puts CR.

    CR line termination character in Macintosh

    This is one useful feature that allows you to convert files to a different formats.

    Bonus Tip

    You can set up Notepad++ to create specific format files by default. There is a setup available.

    Go to Settings- -> Preferences–> New Document.

    New Document Setup

    Go to the Format(Line ending) section. You have Windows(CR LF), UNIX(LF), and Macintosh(CR) options available.

    Choose format as per your requirement and click the Close button.

    Summary

    Notepad++ makes it really easy to convert the file from Windows <–> UNIX <–> Mac format.

    I think we have covered this EOL topic very well and you learn a good tip. Please do share and subscribe.

     

    Notepad++
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow to install 0AD Linux Game on Ubuntu 20.04
    Next Article How to install Ruby on Rails on Ubuntu 20.04
    Sandi
    • Website
    • Twitter

    I am Oracle Certified Associate(OCA) working in Oracle Domain since last 15 Years. Started this blog to share knowledge about different Technologies mostly focussing on Oracle.

    Related Posts

    How to Set Notepad++ as Default Editor in Windows

    March 2, 2022

    Tab Settings in Notepad++ ( Convert Tabs to Spaces)

    January 13, 2022

    How to change text case (lower, upper and proper) in Notepad++

    December 18, 2021
    Add A Comment

    Comments are closed.

    Recent Posts
    • How to Open a Terminal in Linux Mint
    • How to Restart Ubuntu From the Terminal
    • How to Install Zoom on openSUSE
    • How to Install xArchiver on Debian 11
    • How to Install UNRAR on Fedora 35/34/33/32
    Affiliate Disclosure
    This website contains Affiliate Links. We get small commission for purchases made through affiliate links (at no extra cost to you)
    Facebook Twitter Instagram Pinterest
    • Debian
    • Ubuntu
    • Mint
    • Fedora
    • CentOS
    • openSUSE
    • Chrome
    • XAMPP
    • Forums
    • Notepad++
    • Privacy Policy
    • About Me
    © 2022 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.