LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   howto save as text file? (https://www.linuxquestions.org/questions/linux-newbie-8/howto-save-as-text-file-914988/)

Windowsfan 11-22-2011 08:09 PM

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.

sag47 11-22-2011 08:36 PM

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.

ukiuki 11-22-2011 08:40 PM

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

GlennsPref 11-22-2011 09:18 PM

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

Telengard 11-22-2011 10:48 PM

If all else fails you could try copy/paste into a text editor.

EDDY1 11-22-2011 11:27 PM

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.

Windowsfan 11-24-2011 08:46 PM

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

Quote:

Originally Posted by ukiuki (Post 4531196)
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


Windowsfan 11-24-2011 08:51 PM

Thanx. the simplest way is from ukiuki. works great!
 
The reply from member ukiuki worked perfectly.


Quote:

Originally Posted by GlennsPref (Post 4531217)
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


Windowsfan 11-24-2011 08:56 PM

Thanx!
 
It was best explained by member ukiuki.


Quote:

Originally Posted by sag47 (Post 4531194)
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.


ukiuki 11-24-2011 10:04 PM

Im glad to help !

Regards

GlennsPref 11-25-2011 03:17 AM

I'm glad too!

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

Cheers, Glenn


All times are GMT -5. The time now is 03:50 AM.