Linux - General This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-08-2012, 07:42 PM
|
#1
|
|
Member
Registered: Apr 2009
Location: El Salvador
Distribution: Slackware -current
Posts: 164
Rep:
|
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?
|
|
|
|
02-08-2012, 07:48 PM
|
#2
|
|
Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian
Posts: 5,347
|
This seems to have to do with Linux/Unix and Windows using different end-of-line character formats.
Searching for "convert text file linux to windows" turned up lots of stuff.
This seemed to be one of the clearer ones: http://www.cyberciti.biz/faq/convert...ows-textfiles/
|
|
|
|
02-09-2012, 05:00 AM
|
#3
|
|
Senior Member
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 4,548
|
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.
|
|
|
|
02-09-2012, 05:17 AM
|
#4
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
Alternatively WordPad, MS Word, LibreOffice Writer etc. display *n*x format files OK in Windows (no good for editing code though).
|
|
|
|
02-09-2012, 06:46 AM
|
#5
|
|
Senior Member
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144
|
Hi,
Try using PSPad or Notepad++ on your windows machine to open the files from linux.
You can also then save them to linux format to make them readable on server again.
|
|
|
|
02-09-2012, 09:46 AM
|
#6
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
Quote:
Originally Posted by lithos
You can also then save them to linux format to make them readable on server again.
|
How do you do that with notepad++? I netsearched for it last night but did not find the answer.
|
|
|
|
02-09-2012, 01:11 PM
|
#7
|
|
Senior Member
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144
|
Quote:
Originally Posted by catkin
How do you do that with notepad++? I netsearched for it last night but did not find the answer.
|
Maybe you searched for this ?
Menu - Edit / EOL Conversion ...
(see att. pic)
Although PSPad has it more visible : Menu / Format: DOS/UNIX/MAC (pic 2)
|
|
|
1 members found this post helpful.
|
02-09-2012, 09:09 PM
|
#8
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
Quote:
Originally Posted by lithos
Maybe you searched for this ?
Menu - Edit / EOL Conversion ...
(see att. pic)
|
Exactly what I was looking for. Thanks lithos 
|
|
|
|
02-09-2012, 09:39 PM
|
#9
|
|
ReliaFree Maintainer
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware, Cross Linux from Scratch, Gentoo
Posts: 2,663
Rep: 
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:32 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|