LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-11-2004, 08:36 AM   #1
plnelson
Member
 
Registered: Oct 2004
Location: Massachusetts, USA
Distribution: SuSE
Posts: 39

Rep: Reputation: 15
Common text editor?


Now that I have Samba set up to see Windows shares from my Suse Linux system I want to share some text files.

When I edit a file in Windows using the default Windows ASCII text editor "Notepad" I can read it OK in Kate or Kwrite from Linux.

But when I edit a file in Kate or Kwrite on Linux, it loses all linefeed information in Notepad!

I assume this is because of the different ways they treat end-of-line cases. (Windows uses CRLF, Linux apparently just uses LF). How do I get around this? I assume there's an option on the Linux side to do a Save As in a format that looks like the Windows format. Under kate there seems to be several dozen "Save As" format options.
 
Old 10-11-2004, 08:52 AM   #2
CSIXTY4
LQ Newbie
 
Registered: Mar 2004
Location: Lombard, IL.
Distribution: SUSE 9.0 & Fedora Core 2
Posts: 21

Rep: Reputation: 15
Smile

In kate, under the "tools" menu, there's an option to set the "end of line" type.

Last edited by CSIXTY4; 10-11-2004 at 09:15 AM.
 
Old 10-11-2004, 08:58 AM   #3
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
well windows does its best to be incompatible at all times............

I don't use "notepad or wordpad" in windows.......I use Utraedit32........
this is a great text/hex editor and I can also write Macros with it..........
There is really Nothing wrong with the way your Linux system saves text files..........its the way windows interprets them!! Not really sure how you can
force windows to play nice............other than using a different windows text editor------
 
Old 10-11-2004, 09:02 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
Window wordpad will decode a linux ASCII textfile correctly but not save as one. If editing linux config files in windows make sure that they are saved or converted to a unix format. Some applications like Apache will fail to start if the files are saved in a DOS format.
 
Old 10-11-2004, 09:20 AM   #5
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 46
I use EditPad and it can read Linux files and convert between Windows/Linux end of line characters.
 
Old 10-11-2004, 09:32 AM   #6
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Another vote for Ultraedit, simply awesome program. Wish there was a unix/linux port, although it will run from Wine.
 
Old 10-11-2004, 10:21 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
I like the windows Textpad ASCII editor myself. It can also save in either format.
 
Old 10-11-2004, 10:28 AM   #8
jbogins
LQ Newbie
 
Registered: Nov 2003
Distribution: fedora core 1
Posts: 29

Rep: Reputation: 15
i use unix2dos in a windoes batch script that copys/converts files from a RH7 server.
It does the job
 
Old 10-11-2004, 10:38 AM   #9
plnelson
Member
 
Registered: Oct 2004
Location: Massachusetts, USA
Distribution: SuSE
Posts: 39

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by 320mb
well windows does its best to be incompatible at all times............
My understanding is that Windows ASCII requires carrige returns and linefeeds as two different characters (hex 0D, hex 0A). Since carriage returns and linefeeds really do represent two distinct behaviors it seems perfectly logical to distinguish between them.

I also question your observation about "compatibility" since Windows is on about 90% of desktops worldwide, so whatever Windows does is, by definition, the most compatible. It's the same reason why Star Office / Open Office -type programs make sure they're compatible with Windows word-processing and spreadsheet file formats but Windows has no need to be compatible with Unix/Linux formats.

Anyway the solution suggested by CSixty4 is the most logical one. Using a new editor such as Utraedit32 or Textpad in order to read and edit the Linux-edited files would be impractical because it would require that every Windows PC on our network use that editor, including visitors who just happen to bring their own laptops.
 
Old 10-11-2004, 02:51 PM   #10
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally posted by plnelson
I also question your observation about "compatibility" since Windows is on about 90% of desktops worldwide, so whatever Windows does is, by definition, the most compatible. It's the same reason why Star Office / Open Office -type programs make sure they're compatible with Windows word-processing and spreadsheet file formats but Windows has no need to be compatible with Unix/Linux formats.
But linux programs will read 100% of text files - windows will only be happy with those saved in its own format. Likewise linux has built-in (or at least the option to build in) support for most types of filesystem, windows will support only its own Being the most popular doesn't make it the most compatible, if anything it means less popular systems must make extra effort to support all formats and will therefore be more compatible than windows or risk not catching on. Being most popular and being on the most systems does not make something more compatible "by definition" it makes it more available.

It is being able to accept the widest range of formats that makes something 'more compatible', not having its own format as the most common.
 
Old 10-11-2004, 03:49 PM   #11
plnelson
Member
 
Registered: Oct 2004
Location: Massachusetts, USA
Distribution: SuSE
Posts: 39

Original Poster
Rep: Reputation: 15
Quote:
It is being able to accept the widest range of formats that makes something 'more compatible', not having its own format as the most common. [/B]
To me "most compatible" refers to the format that is read AND WRITTEN by the largest number of actual systems. So, to me, "most compatible" does equate to most popular.

Thus, by default, the Windows format can be read by 100% of computers, and is the one written by 90%. The Linux format is only read by default by Linux (and Mac's?).

That's why I said that the solution suggested by CSixty4 - setting kate to use the Windows end-of-line type - produced the most compatible result because it would then be readable by default by the vast majority of computers.
 
Old 10-11-2004, 05:02 PM   #12
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally posted by plnelson
To me "most compatible" refers to the format that is read AND WRITTEN by the largest number of actual systems. So, to me, "most compatible" does equate to most popular.

Thus, by default, the Windows format can be read by 100% of computers, and is the one written by 90%. The Linux format is only read by default by Linux (and Mac's?).

That's why I said that the solution suggested by CSixty4 - setting kate to use the Windows end-of-line type - produced the most compatible result because it would then be readable by default by the vast majority of computers.
Ah, you would be referring to the file format - I was referring to the nature of linux programs. We're both right, I like that outcome
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 12:28 PM
E3 Text editor Blackout_08 Fedora 1 03-07-2005 02:21 AM
x text editor monohouse Linux - Software 8 11-08-2004 07:09 AM
Best Text Editor? Ekim Gram Linux - Software 4 05-24-2003 01:36 PM
vi text editor keevitaja Linux - Newbie 4 08-23-2002 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration