text files written in linux lose format in windows?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
text files written in linux lose format in windows?
Sometimes i have to write small text files in linux using kate, nano or any other text editor, i save them in a separate partition so i can access to them from windows, but when i open my files, all the text appears in one line. Same thing happens with source code files, sometimes i have to share code with friends and when they open the file is just a mess in one line with no spaces.
is there something i can configure so the format stays the same?
Look at commands such as unix2dos and of course dos2unix for information about the "end of line" issue, but this may or may not be your problem.
The "end of line issue" is that the end of a line in a text-file might be denoted, variously, by the CR character ("carriage return"), the LF character ("line feed"), or some combination of the two.
But, in general, files can "lose their formatting" simply because the word-processor in question does not understand the file's format. If you're using, say, the ubiquitous Microsoft Word, this program has many file-format recognition and conversion filters that may or may not be installed by default but that can be installed with Add/Remove Programs or by dialogs within the application itself. Working the problem the other way, some Linux-based tools can save files in more palatable-to-Word formats.
As for myself, I got tired of buying Microsoft licenses and I simply use OpenOffice in both places. Works fine. I don't feel "slighted" and I don't feel "cheap," but it so happens that OO (which now has "Bill's favorite nemesis and contract Bridge partner, Larry Ellison," behind it) does everything that I need to do such that I really don't notice the difference.
Last edited by sundialsvcs; 02-09-2012 at 05:03 AM.
I'll throw (g)Vim and Geany on the list of editors that allow you to set the EOL character. I use both on Linux and Windows when I need to share files. It's nice to work on code on both platforms without having to worry about trivial things like EOL characters. Especially since the EOL character appears as a change to Subversion (IIRC).
Last edited by weibullguy; 02-09-2012 at 09:42 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.