Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jongewehr

macrumors 6502
Original poster
May 1, 2009
280
0
hey guys, im savein some .txt files on the mac an openin them on a pc, an they open weird on the pc, without the line breaks

is there a settin in texteditor so windows can see it like i see it on the mac?
 
hey guys, im savein some .txt files on the mac an openin them on a pc, an they open weird on the pc, without the line breaks

is there a settin in texteditor so windows can see it like i see it on the mac?

Notepad is a bad program. Every time it see the character of line break created on UNIX it won't recognize it and create the formal line break of the Windows and of the UNIX, messing around all your text. Try using another text editor.
 
There has always been an issue with "new line" some systems defined it as just 'c/r' and other defined it as 'c/r lf' It always annoyed me when I had to switch around between different systems.
 
Yeah, by changing the line endings to Windows formatted.

Alternatively you could just use a decent text editor on Windows like Notepad++.
 
Text Editor has all those options, u think u could just change the break to windows format.. oh well
 
i ment to say , why cant osx save it the windows way

Because it's not Windows. Linux does it a different way from Windows and Mac. When on a Mac, it only makes sense a program would save it in a Mac format. I use text editors that let me choose line endings and encoding types (BBEdit). TextEdit and Notepad are just too basic for me as a developer.
 
Because it's not Windows. Linux does it a different way from Windows and Mac. When on a Mac, it only makes sense a program would save it in a Mac format. I use text editors that let me choose line endings and encoding types (BBEdit). TextEdit and Notepad are just too basic for me as a developer.

I've no problems opening Line breaks made by Linux/Mac on Linux/Mac. The issue is notepad by windows.

@OP
Choose another text editor for windows, do not use that crap called notepad.
Try using notepad++, as suggested before on this thread.
 
Linux does it a different way from Windows and Mac.

For Mac OS 9 and below, this is true. For Mac OS X and newer, however, it is not; like most other Unix-like systems it uses the '\n' character as the newline. Microsoft apparently couldn't decide which one was better and implemented both :/

Mac OS 9: \CR (\r)
Mac OS X, Linux, *BSD, etc: \LF (\n)
Windows: \CR\LF (\r\n)


WordPad can read both \LF and \CR\LF with no problems, it's only Notepad that panics.
 
For Mac OS 9 and below, this is true. For Mac OS X and newer, however, it is not; like most other Unix-like systems it uses the '\n' character as the newline. Microsoft apparently couldn't decide which one was better and implemented both :/

Mac OS 9: \CR (\r)
Mac OS X, Linux, *BSD, etc: \LF (\n)
Windows: \CR\LF (\r\n)

Ah, that's right. Thanks for the clarification. I always set my editors to Linux so I never really thought about it.
 
Windows inherited this from DOS, which followed the old teletype regime where an operator needed to return the carriage to position 1 (CR) then advance the roller one line (Line Feed). If you've got an old DOS computer around hit CTRL - G. It'll beep because that's the bell code teletype operators used to use to wake up people on the other end.

One of the best Mac text editors to handle the Mac -> PC transition would be Tex-Edit by Trans Tech Software (not TextEdit from Apple).

Another alternative would be to use AppleScript:

Code:
tell application "TextEdit"
	set output to ""
	repeat with n from 1 to number of paragraphs of document 1
		set output to output & (paragraph n of document 1) & (ASCII character 13) & (ASCII character 14)
	end repeat
	
	make new document with properties {text:output}
	
end tell

mt
 
What if I'm creating text files to be seen by others? ... who might likely be on a PC and might double-click to open?

So I want a solution that works for that case.

Should I save the files as .rtf, will that work? Or would a more reliable solution be to make .html pages of them? Or ... ?
 
What if I'm creating text files to be seen by others? ... who might likely be on a PC and might double-click to open?

So I want a solution that works for that case.

Should I save the files as .rtf, will that work? Or would a more reliable solution be to make .html pages of them? Or ... ?

Please read over the thread more closely as it already answers your questions. If you feel it doesn't, you may want to explain what further explanation you're needing.
 
Please read over the thread more closely as it already answers your questions. If you feel it doesn't, you may want to explain what further explanation you're needing.

For now, I want to use TextEdit and no scripting and achieve the desired effect (line breaks show as entered) on various (Windows and other) systems.

The only solutions to this I know are (1) to use .rtf or (2) to make .html files and put in my <br>s where wanted. So my question is will TextEdit's .rtf be reliable enough for double-clicking over various (Windows and other) systems? or would I best make the files .html? Or am I still missing something in the thread?

(In the future, I will probably try BBEdit or one of the other text editors, preferably just one of them ... )
 
For now, I want to use TextEdit and no scripting and achieve the desired effect (line breaks show as entered) on various (Windows and other) systems.

The only solutions to this I know are (1) to use .rtf or (2) to make .html files and put in my <br>s where wanted. So my question is will TextEdit's .rtf be reliable enough for double-clicking over various (Windows and other) systems? or would I best make the files .html? Or am I still missing something in the thread?

(In the future, I will probably try BBEdit or one of the other text editors, preferably just one of them ... )

Kind of depends on what kind of document you're writing, plain text or text that allows styling (e.g., bold, underline, italics, etc.). For plain text, if you save the file with a .txt extension, it'll open with Notepad on Windows. If the file was created with TextEdit, the line endings won't be right. In the plain text case, I would recommend TextWrangler (BBEdit's free cousin) as it can set the line ending style for Windows.

If you're doing any type of styling you can use TextEdit without issues (more or less). You can either choose RTF or you can use the DOC extension, which will open in MS Word by default for most Windows users. TextEdit's RTF and DOC compatibility should be pretty good with Windows.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.