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 07-21-2007, 03:31 AM   #1
VicRic
Member
 
Registered: Sep 2006
Location: Vancouver, Canada
Distribution: Mandriva 2010 / Fedora 15 2.6.40.6-0
Posts: 44

Rep: Reputation: 16
problem saving with gEdit and then viewing with Notepad


Hi. I'm using gEdit in both Fedora 6 and SUSE 10. I mostly use it to paste interesting text that I cut from web pages and then saving the text into a file.

The problem is that when I save the text into a file I get the following default option:

http://www.techspot.com/gallery/data.../geditsave.png

if I accept that and save and then move the file to a Windows machine and open it with Notepad then the text does not look as it should - you'd see all the text in one line, and the line breaks as the 'blank square' special character.

Any idea on how can I solve this? I notice that Notepad saves its text into ANSI encoding, and gEdit only gives me options to save it in 'Current Locale UTF-8', 'Western ISO 8859-1', 'Western ISO 8859-15'. I don't see the option in gEdit to save the file in ANSI encoding, and I cannot 'Add' it.

BRgds
 
Old 07-21-2007, 03:40 AM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 57
Linux saves text files differently then windows
you have to use a conveter to convert the files from linux to windows
 
Old 07-21-2007, 03:41 AM   #3
rocket357
Member
 
Registered: Mar 2007
Location: 127.0.0.1
Distribution: OpenBSD-CURRENT
Posts: 476
Blog Entries: 122

Rep: Reputation: 74
A (very) quick and dirty solution is to open it in Wordpad and resave it. Wordpad seems to handle encoding differently than Notepad.
 
Old 07-21-2007, 03:42 AM   #4
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
unix2dos is probably what you need. Most distros have this package in their repos.
 
Old 07-21-2007, 02:00 PM   #5
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Rep: Reputation: 32
dos2unix/unix2dos

dos2unix --> for files created in Windows
unix2dos --> for files created in Linux and UNIX

Pretty sure that should work.
 
Old 07-22-2007, 01:27 AM   #6
VicRic
Member
 
Registered: Sep 2006
Location: Vancouver, Canada
Distribution: Mandriva 2010 / Fedora 15 2.6.40.6-0
Posts: 44

Original Poster
Rep: Reputation: 16
Thanks guys.

Using WordPad does solve the problem: you open the 'unix' file with WordPad and it's already readable. If you want to keep a converted copy then select in WordPad to save the file as type TextDocument-MSDOSFormat.

Unix2dos also works; too bad it's a Terminal utility.
I use it like this:
$ unix2dos -n inputfile outputfile.txt
and then move the file outputfile.txt to the Windows machine.

BRgds
 
Old 07-24-2007, 09:30 PM   #7
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Rep: Reputation: 32
Lightbulb Notepad++

The other tool you could use and I really like is Notepad++, its free and you can find it at sourceforge.net (http://sourceforge.net/projects/notepad-plus/) I like this tool for writing scripts in and you can easily open a new document and copy your work over then save it as the txt file (which would default to DOS because Notepad++ is a Windows APP). The documents you currently have open in the program are also in tabs so you can switch through many documents at once - great for multitasking.

Enjoy!
 
  


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
Notepad editing problem >>BLACKHOLE<< General 15 04-12-2007 10:47 PM
gedit problem installing warzone jbumgar Linux - Newbie 4 09-07-2006 11:18 AM
Text selection problem with Gedit liaohaohui Linux - Software 0 11-18-2004 05:18 AM
wine problem!!load notepad but don't know what to do next ngan_yine Linux - Newbie 4 12-15-2003 03:57 AM


All times are GMT -5. The time now is 03:04 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration