LinuxQuestions.org
Register a domain and help support LQ
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 11-22-2011, 09:09 PM   #1
Windowsfan
LQ Newbie
 
Registered: Nov 2011
Location: Mexicali & Phoenix & Munich
Distribution: Super OS 10.10
Posts: 4

Rep: Reputation: Disabled
Unhappy howto save as text file?


I am a struggeling Linux-Fan for 20 years and still have not lost
all hope.
How can I save a text file from the internet as text?
I chose a newspaper article, select "print", then it appears as
simple text file on the monitor. I cancel the message which
wants me to chose a printer, instead I want to "save file",
but as text file.
In Windows this is no problem at all, and I end up with an
almost clean ASC file where I then edit out the few unwanted
extras with Notepad.
Under Linux the saved file contains an insurmountable bunch of
crap.
I verified the problem by copying a Windows-textfile to Linux,
it opened flawlessly and without containing any crap under gedit.
So far I have not managed to convert away from Windows, and this is one mayor reason.
 
Old 11-22-2011, 09:36 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,832
Blog Entries: 36

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Depends on what browser you're using. Essentially all you need to do is click File > Save As... and then save it as "somefile" with no extension or you can save it as "somefile.txt" if it makes you feel better. I do both on different occasions.
 
1 members found this post helpful.
Old 11-22-2011, 09:40 PM   #3
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Lets say your browser is Firefox, you have the option under File>Save Page As>
once you click there an dialog box will show up, then click 'Browser for other folders'
then in the bottom right of this dialog box will see an drop-down menu where you can change it to text files.

Note if you just change the file extension to .txt it still save all the html code.

Regards

Last edited by ukiuki; 11-22-2011 at 09:49 PM. Reason: misstype
 
1 members found this post helpful.
Old 11-22-2011, 10:18 PM   #4
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
Hi, I'm not sure you are getting helpful answers so far.

I know and you probably know you can save as text, but that does not remove all the (html?) tags for links etcetera.

As well you probably know you can print to file, it may be a single web page frame or a selection of them to ps (postscript) or PDF. But

that is not plain text either.

One avenue I think may work for you is to save as a text file and then use sed to remove the lines with < or > then save it.

The one bash script could carry all the commands you require, but I have not done this.

The tools sed, grep & awk are outlined and demonstrated at the ibm site and as magazine articles.

Jerry Peek has some tutorials that have been published...
http://www.jpeek.com/

His boot camp papers are quite good.
http://www.jpeek.com/articles/linux_magazine.html


and IBM developer works is another good tutorial place to look...
https://www.ibm.com/developerworks/v...for+a+new+user

Hopefully someone here will offer a simple code to use and reuse.

Regards Glenn

Last edited by GlennsPref; 11-22-2011 at 10:19 PM. Reason: spelling
 
Old 11-22-2011, 11:48 PM   #5
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 147Reputation: 147
If all else fails you could try copy/paste into a text editor.
 
1 members found this post helpful.
Old 11-23-2011, 12:27 AM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
The2 parties that suggested changing the extension type to .txt are actually correct in saving as text files also wins can read it when opened.
 
1 members found this post helpful.
Old 11-24-2011, 09:46 PM   #7
Windowsfan
LQ Newbie
 
Registered: Nov 2011
Location: Mexicali & Phoenix & Munich
Distribution: Super OS 10.10
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thumbs up Thanx - works great!!!

Amazing - it is so simple if you know. Thank you!

Quote:
Originally Posted by ukiuki View Post
Lets say your browser is Firefox, you have the option under File>Save Page As>
once you click there an dialog box will show up, then click 'Browser for other folders'
then in the bottom right of this dialog box will see an drop-down menu where you can change it to text files.

Note if you just change the file extension to .txt it still save all the html code.

Regards
 
Old 11-24-2011, 09:51 PM   #8
Windowsfan
LQ Newbie
 
Registered: Nov 2011
Location: Mexicali & Phoenix & Munich
Distribution: Super OS 10.10
Posts: 4

Original Poster
Rep: Reputation: Disabled
Smile Thanx. the simplest way is from ukiuki. works great!

The reply from member ukiuki worked perfectly.


Quote:
Originally Posted by GlennsPref View Post
Hi, I'm not sure you are getting helpful answers so far.

I know and you probably know you can save as text, but that does not remove all the (html?) tags for links etcetera.

As well you probably know you can print to file, it may be a single web page frame or a selection of them to ps (postscript) or PDF. But

that is not plain text either.

One avenue I think may work for you is to save as a text file and then use sed to remove the lines with < or > then save it.

The one bash script could carry all the commands you require, but I have not done this.

The tools sed, grep & awk are outlined and demonstrated at the ibm site and as magazine articles.

Jerry Peek has some tutorials that have been published...
http://www.jpeek.com/

His boot camp papers are quite good.
http://www.jpeek.com/articles/linux_magazine.html


and IBM developer works is another good tutorial place to look...
https://www.ibm.com/developerworks/v...for+a+new+user

Hopefully someone here will offer a simple code to use and reuse.

Regards Glenn
 
Old 11-24-2011, 09:56 PM   #9
Windowsfan
LQ Newbie
 
Registered: Nov 2011
Location: Mexicali & Phoenix & Munich
Distribution: Super OS 10.10
Posts: 4

Original Poster
Rep: Reputation: Disabled
Smile Thanx!

It was best explained by member ukiuki.


Quote:
Originally Posted by sag47 View Post
Depends on what browser you're using. Essentially all you need to do is click File > Save As... and then save it as "somefile" with no extension or you can save it as "somefile.txt" if it makes you feel better. I do both on different occasions.
 
Old 11-24-2011, 11:04 PM   #10
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Im glad to help !

Regards
 
Old 11-25-2011, 04:17 AM   #11
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
I'm glad too!

Simpler than I thought, I can't see the trees for the forest sometimes.

Cheers, Glenn
 
  


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
gedit cannot save text file, type mailbox file ! snailchess Linux - Newbie 10 02-26-2011 05:57 AM
Scan and Save As a Text file mickeyboa Fedora 6 09-30-2010 04:58 PM
LXer: HowTo: Save A File In Vim / Vi Without Root Permission LXer Syndicated Linux News 0 04-11-2010 08:10 AM
Save text to the beginning of file. c0m4r Linux - General 3 05-24-2009 12:53 PM
wiring to a text file and being able to save and add to it mrobertson Programming 1 07-27-2005 03:27 PM


All times are GMT -5. The time now is 09:00 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