Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I tell the computer not to copy unimportant information ?

For example if I go to this page and copy the first paragraph, I'd get:

Sentence spacing is the horizontal space between sentences in typeset text. It is a matter of typographical convention.[1] Since the introduction of movable-type printing in Europe, various sentence spacing conventions have been used in languages with a Latin-derived alphabet.[2] These include a normal word space (as between the words in a sentence), a single enlarged space, two full spaces, and, most recently in digital media, no space.[3] Although modern digital fonts can automatically adjust a single word space to create visually pleasing and consistent spacing following terminal punctuation,[4] most debate is about whether to strike a keyboard's spacebar once or twice between sentences.[5]

I do not wish to copy those <sup> words. This is what I actually wanted:

Sentence spacing is the horizontal space between sentences in typeset text. It is a matter of typographical convention. Since the introduction of movable-type printing in Europe, various sentence spacing conventions have been used in languages with a Latin-derived alphabet. These include a normal word space (as between the words in a sentence), a single enlarged space, two full spaces, and, most recently in digital media, no space. Although modern digital fonts can automatically adjust a single word space to create visually pleasing and consistent spacing following terminal punctuation, most debate is about whether to strike a keyboard's spacebar once or twice between sentences.

Of course I could do this manually, but there must be a better solution. Any ideas?

The answer below uses regex but the problem with that is that it doesn't work for all times.

See, if the actual text itself contains [ and ] which aren't -ed, obviously they are part of the information and should not be removed, but wiht the regex it will be removed, Big error!

share|improve this question
    
Those are references which probably are important because they often support the credibility of the information being presented. Including references is helpful, particularly to researchers. –  Randolf Richardson Aug 17 '11 at 6:19
    
@Randolf Including references can be helpful, especially for researchers. not for normal-beings who just want the information –  Pacerier Aug 17 '11 at 6:20
    
Your word processor's search and replace feature, possibly called from a macro, could come in handy here. –  Keith Aug 17 '11 at 6:34
    
I did upvote your question, by the way, because I do think it's a good one. Regarding references, many people expect to see them, especially professors in university (if you're planning to attend one, you'll almost certainly find that most professors will expect references be included in any research papers you write, and you'll probably hear other students talking about references from time-to-time). –  Randolf Richardson Aug 17 '11 at 6:43
    
@Randolf i mean i just want to store the information for personal future reading and use. –  Pacerier Aug 17 '11 at 12:22
show 2 more comments

1 Answer 1

up vote 2 down vote accepted

A bookmarklet is your friend...

Create a new browser bookmark and copy the javascript code below into it - when you want to copy some text from wikipedia, just click it beforehand and it'll remove all instances of [n] to meet your requirement in the question.

javascript:function a (){document.body.innerHTML=document.body.innerHTML.replace(/<sup\b[^>]*>(.*?)<\/sup>/gi, "" );return;}; a();

Behind the scenes, it's just doing a regular expression search and replace of all <sup>...</sup> HTML tags on the page.

I've just tried this in IE7 and it works fine, so hopefully should be ok in other browsers too.

I'll credit this SO thread with pointing me in the right direction - I knew a bookmarklet was the way to go, but had never written one before.

share|improve this answer
    
+1, this is the only way I can think of doing this. Even additional browser extensions would have to use some kind of Javascript analysis to do this (and indeed most do). –  Breakthrough Aug 31 '11 at 15:20
    
this is actually pretty cool! –  Pacerier Sep 1 '11 at 1:49
    
@Pacerier - thanks! –  Stuart McLaughlin Sep 1 '11 at 8:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.