Results 1 to 4 of 4

Thread: Arch How to convert a text file to use line feeds, etc so it can be read in Windows

  1. #1
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu

    Arch How to convert a text file to use line feeds, etc so it can be read in Windows

    I have been using Arch Linux with just Xfce and mousepad as the text editor for nearly a year now.
    But I have yet to figure out how to save text files with Windows line returns, etc at the end of the lines.

    I know how to do it in Ubuntu just fine, but any time I save a text file on my USB drive and then copy it into Windows, it's just a single long line.
    So, it takes a lot of work to get it like it was in Arch.

    Does any one know how to get mousepad to do this?
    Any help would be greatly appreciated.
    Thanks in advance.
    Last edited by Cavsfan; March 28th, 2016 at 04:04 PM.

  2. #2
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to convert a text file to use line feeds, etc so it can be read in Windows

    This probably holds the key if I can figure out the right command: https://wiki.archlinux.org/index.php...tilities#iconv

    Problem is booting into windows and back to Arch..
    Last edited by Cavsfan; March 24th, 2016 at 07:11 PM.

  3. #3
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: How to make mousepad produce line breaks, etc that windows can read

    Not sure i understand fully...maybe >Format. "Word Wrap"
    Cavsfan i must confess I just don't use mousepad enough to speak anything relevant.
    There is always Nano, Vim, jEdit, Just to point to a few editors that don't pull-in a lot of excess deps..
    Sorry Old Friend I was not more helpful.
    Kind Regards

  4. #4
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to convert a text file to use line feeds, etc so it can be read in Windows

    Quote Originally Posted by runrickus View Post
    Not sure i understand fully...maybe >Format. "Word Wrap"
    Cavsfan i must confess I just don't use mousepad enough to speak anything relevant.
    There is always Nano, Vim, jEdit, Just to point to a few editors that don't pull-in a lot of excess deps..
    Sorry Old Friend I was not more helpful.
    Kind Regards
    Thanks for trying Buddy! I know you probably don't have windows on your machine so you cannot try different things to see if they work.
    But, I did solve the problem and the solution was amazingly simple.

    At first I thought this would work:
    Code:
    iconv -f UTF-8 -t WINDOWS-1251 foo >foo.txt
    Because once I did that and tried to open it in Arch, it said it was not UTF-8 so it could not read it.
    When I switched it to WINDOWS-1251 it looked good but, when I booted into Windows 10, it was still just a single line.

    Then I found this simple command:
    Code:
    awk 'sub("$", "\r")' foo > foo.txt
    It worked great! It didn't really change the character format of the text. It just added line feeds, etc. So it could be read in either Arch or Windows 10 with the correct line feeds etc.

    I only had to boot into Windows 10 twice, so I only cried for a couple of minutes.

    Mission accomplished!
    I hope someone else can benefit by this thread. Not a whole lot of people that have gone to Arch Linux still also have Windows but I imagine there are a few.

    Kind regards My Friend!
    Last edited by Cavsfan; March 24th, 2016 at 07:12 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •