Results 1 to 10 of 10
  1. #1


    Member Since
    Nov 27, 2006
    Posts
    440
    Specs:
    Power Mac G5 Dual 1.8 GHz
    A way to convert Mac .txt files to Windows .txt files
    I know there aren't 2 types of TXT files, one for OS X, one for Windows.
    I know there's only one type of TXT.

    However, there is one little but quite significant difference between plain text files made in the two OSs:

    In Windows, line breaks are \r\n
    In OS X, they're \n

    As a result,
    while TXT files created in Windows will display correctly in OS X,
    TXT files created in OS X will be missing all the line breaks when opened in Windows.
    (Basically, all the text is displayed on 1 line.)


    So does anyone know of a way to convert all the \n to \r\n in a TXT?


    note:
    I am aware of pseudo-solutions, such as using other formats instead (such as DOC),
    which display the line breaks correctly in both OSs,
    but still, I'd rather be able to use TXT files between the 2 OSs.
    Cog 0.07 audio player - cogx.org
    AAC, AIFF, APE, FLAC, M4A, MP3, MPC, OGG, SHN, WAV, WV, tracker formats,
    VG music formats, cue sheets, M3U & PLS, Growl, Last.fm, Apple Remote
    Latest Nightly Build (0.08) (new interface!) - Got ideas? Report bugs?

  2. #2

    eric's Avatar
    Member Since
    Nov 04, 2006
    Location
    twin cities, mn, usa
    Posts
    8,708
    that's odd...

    i haven't noticed that, but probably because i go xp > os x pretty much all the time rather than the other way.

    certainly worth investigating!
    Please participate in our Member of the Month polls. Every vote counts! And remember to use the user reputation system!
    ["Dear Homer, I. O. U. one emergency donut. Signed, Homer." - Note by Homer Simpson]

  3. #3


    Member Since
    Nov 27, 2006
    Posts
    440
    Specs:
    Power Mac G5 Dual 1.8 GHz
    I think most people don't notice this because by default, TextEdit is in RTF mode.
    (I believe line breaks in RTFs are also OK between the 2 OSs; I know for sure it's the case with DOCs.)

    I set it to TXT mode because I don't want/need fancy shmancy formatting when I use TextEdit; I just want plain text.

    Characters, tabs, line breaks... that's all.

    Keeps the file size as small as possible too.
    Cog 0.07 audio player - cogx.org
    AAC, AIFF, APE, FLAC, M4A, MP3, MPC, OGG, SHN, WAV, WV, tracker formats,
    VG music formats, cue sheets, M3U & PLS, Growl, Last.fm, Apple Remote
    Latest Nightly Build (0.08) (new interface!) - Got ideas? Report bugs?

  4. #4

    eric's Avatar
    Member Since
    Nov 04, 2006
    Location
    twin cities, mn, usa
    Posts
    8,708
    ah. not that that would be my issue, i use smultron on os x and textpad on windows. pretty sure they're both basic text only. i think i just must not have opened and os x native text docs on my work machine yet...

    ooh! maybe i have some on the ext drive in my bag! i'll have to check.

    edit: nope. only music and image files.
    Please participate in our Member of the Month polls. Every vote counts! And remember to use the user reputation system!
    ["Dear Homer, I. O. U. one emergency donut. Signed, Homer." - Note by Homer Simpson]

  5. #5

    dtravis7's Avatar
    Member Since
    Jan 04, 2005
    Location
    Modesto, Ca.
    Posts
    28,981
    Specs:
    iMac 2010 27" QuadI7 OSX10.11, iMac 2008 OSX10.11, MBP Late2011OSX10.11 , iPad Air, iPhone 3GS
    TextWrangler should work fine. I will give it a try and get back to you. I have my TextEdit set to .txt also and RTF turned off.

    Give Textwrangler a try. It's free.

  6. #6

    yogi's Avatar
    Member Since
    Jan 14, 2005
    Location
    Zurich, Switzerland
    Posts
    2,078
    Specs:
    Mac Mini, iPad Air 2, iPhone 5S, Apple TV 4th Gen, Apple Watch (38mm Link Bracelet)
    TextWrangler ... just supplying the link, since dtravis seems a bit lazy today
    If you liked this post, consider using the Reputation System by hitting the icon on the left.

  7. #7


    Member Since
    Nov 27, 2006
    Posts
    440
    Specs:
    Power Mac G5 Dual 1.8 GHz
    TextWrangler seems to do the trick!

    Just to make sure I'm not mistaken, I'm basically supposed do this to convert a OS X-made file's line breaks:

    -Open in TextWrangler
    -Save As
    -Click "Options..." at the bottom
    -Change "Line Breaks" from "Unix" to "DOS"
    -OK
    -Save

    Is this correct?


    BTW,
    is there a way to make it such that:

    -new files made by TextWrangler are "regular" TXT files (just like those made by TextEdit),
    and not the file kind "TextWrangler text file" (and with the TextWrangler document icon)?
    -new files made by TextWrangler have the ".txt" extensions by default?


    Thanks to all!
    Cog 0.07 audio player - cogx.org
    AAC, AIFF, APE, FLAC, M4A, MP3, MPC, OGG, SHN, WAV, WV, tracker formats,
    VG music formats, cue sheets, M3U & PLS, Growl, Last.fm, Apple Remote
    Latest Nightly Build (0.08) (new interface!) - Got ideas? Report bugs?

  8. #8

    dtravis7's Avatar
    Member Since
    Jan 04, 2005
    Location
    Modesto, Ca.
    Posts
    28,981
    Specs:
    iMac 2010 27" QuadI7 OSX10.11, iMac 2008 OSX10.11, MBP Late2011OSX10.11 , iPad Air, iPhone 3GS
    Quote Originally Posted by yogi View Post
    TextWrangler ... just supplying the link, since dtravis seems a bit lazy today


    dtravis7 was waiting to be sure it would work before saying more. Been so busy I have not even had the time to test it. Glad it works for you.

  9. #9

    walkerj's Avatar
    Member Since
    Feb 13, 2005
    Location
    New Orleans, LA, USA
    Posts
    1,186
    Specs:
    13" Macbook Pro 2.26Ghz Unibody 4G RAM 160G HDD Superdrive
    This is also why I use command line utilities for both OS's, and this is something that goes back to the early days of all the UNIX's and the DOS world.

    You'll note that if you use vi on a text file created by a Windows notepad, for example, will show ^M characters at each newline, while text files created by Mac OS X will look all goofy using windows notepad. Oddly enough, if you edit a text file created by Mac OS X with the "DOS" command line 'edit' command under Windows and just save it, it'll convert the newlines to what Windows expects with the rest of the Windows text editors.

    Over on the Mac side, TextEdit generally seems to handle text files properly regardless of where they are created, but vi will show those 'crlf' characters as a ^M, which is not a big deal, but annoying. The vi command line way I deal with this is:

    :%s/'control-v''control-m'//

    and they will be be converted to 'cr' (carriage return, not carriage return-linefeed) and when you save the file it'll be all well in the UNIX world.

    This is probably all confusing to non-UNIX geeks, but this is something I've had to deal with for the entire 20+ years I've been dealing with text between DOS and UNIX. It's real fun when you have thousands of text scripts that have to be ported across OSes and have to figure out what program can best be used to batch convert them all.

  10. #10


    Member Since
    Mar 30, 2004
    Location
    USA
    Posts
    4,744
    Specs:
    12" Apple PowerBook G4 (1.5GHz)
    Quote Originally Posted by remain View Post
    ...
    BTW,
    is there a way to make it such that:

    -new files made by TextWrangler are "regular" TXT files (just like those made by TextEdit),
    and not the file kind "TextWrangler text file" (and with the TextWrangler document icon)?
    They are plain ASCII text files, just like those from TextEdit. However, they have a creator code that assign them to open in TextWrangler, which means they carry a TextWrangler icon. Other files on your system may have a TextEdit creator code, so they will sow a TextEdit icon and open in TextEdit by default.

    In the same vein, you can have, for example, Photoshop JPEGS, Preview JPEGs, and GraphicConverter JPEGs, even though they are all the same format. Macs can assign the file types to different applications on a file-by-file basis, unlike PCs. You can, if you like, override this by using the "always open with" option; see the "How do I set a default app" link in my sig.
    -new files made by TextWrangler have the ".txt" extensions by default?
    I don't believe so, but I'm sure that, if you send BareBones Software (the company) some feedback, they'll make this a preferences option in the future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. TEXTEDIT - Weird characters in downloaded .txt files
    By welshred in forum OS X - Operating System
    Replies: 8
    Last Post: 06-11-2015, 03:52 AM
  2. Encoding problems with txt files.
    By agathor35 in forum OS X - Apps and Games
    Replies: 0
    Last Post: 12-22-2012, 05:49 PM
  3. How to read Word or txt files on iPhone?
    By sholdzy in forum iOS and Apps
    Replies: 1
    Last Post: 08-29-2010, 08:13 PM
  4. Reader for doc, word, txt files
    By lelik11a in forum OS X - Apps and Games
    Replies: 1
    Last Post: 07-26-2007, 12:58 PM
  5. Palm and .txt files
    By Benjamindaines in forum Schweb's Lounge
    Replies: 0
    Last Post: 05-30-2005, 04:03 PM

Posting Permissions

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