LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-13-2006, 03:25 AM   #1
stardotstar
Member
 
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238

Rep: Reputation: 30
cleaning up text from html in vi


OK, so I know this must be an easy sed/awk thing or something that is done every day;

what I find I am doing is selecting code from web pages and centre click inserting them into vi and what happens is that each line gets incrementally indented thus ruining the formatting of the conf file or whatever.

What I have done is a repeated dw on each line from back to front and all comes into line...

What is the best way to do this? Ie remove the leading tabs or clearspace that comes over when cutting and pasting text from html to plain text.

help appreciated

TIA

Will
 
Old 04-13-2006, 03:50 AM   #2
LinuxGeek
Member
 
Registered: Jun 2002
Posts: 302

Rep: Reputation: 31
You could try doing one of 2 things:


If you'r using vim and not vi, there's an option:

:set paste

which will prevent this indentation. If that doesn't help, you could open the page with a browser such as link and then save the formatted text as a file and extract the text from there.
 
Old 04-13-2006, 06:00 AM   #3
stardotstar
Member
 
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238

Original Poster
Rep: Reputation: 30
God I love answers like that ! Thank you LinuxGeek :set paste is exactly what I need.

Cheers,
Will
 
Old 04-14-2006, 05:37 AM   #4
LinuxGeek
Member
 
Registered: Jun 2002
Posts: 302

Rep: Reputation: 31
You're welcome
 
  


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
a program for text to html??? Chex Linux - Software 3 02-13-2006 10:43 PM
how to convert text(html) back to html. d1l2w3 Linux - Software 4 04-08-2005 08:16 PM
html to text + encoding? David the H. Linux - General 6 11-22-2004 05:10 AM
what are the 'best' text editors (for C, html, js, etc) name_in_use450 Linux - General 4 08-31-2004 08:01 AM
Converting Text To HTML Glock Shooter Programming 6 07-03-2002 06:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:24 AM.

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
Open Source Consulting | Domain Registration