Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Want to paste a Wikipedia page without the reference tags ; How To?

  • 20-08-2006 2:27pm
    #1
    Closed Accounts Posts: 255 ✭✭


    For example ; http://en.wikipedia.org/wiki/Hugh_Grant

    How do I paste this without the "[2]" etc? Or if, when I paste it, how can I get Wordpad to remove them all in one go?

    Not sure where to put this so please move if need be.


Comments

  • Registered Users, Registered Users 2 Posts: 1,238 ✭✭✭Kwekubo


    Do you mean you want to copy and paste the article without including the footnotes? Why not just delete the little numbers after you copy and paste? There's only three in this article. You might also find the printable version of the article more useful for this purpose.


  • Closed Accounts Posts: 36,634 ✭✭✭✭Ruu_Old


    moved from AH.


  • Closed Accounts Posts: 255 ✭✭Saskia


    I just used that as an example, albeit not a great one for what I need to do. Some of the pages I'll be pasting will have dozens of suxh tags and removing them all one by one is a pain in the ass. help!!


  • Closed Accounts Posts: 255 ✭✭Saskia


    Thanks Ruu. PS; do you live on Boards? :p Excellent new Mod :)


  • Closed Accounts Posts: 36,634 ✭✭✭✭Ruu_Old


    Saskia wrote:
    Thanks Ruu. PS; do you live on Boards? :p Excellent new Mod :)

    Yep the admins let me sleep on the doorstep. :)


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,421 ✭✭✭Steveire


    This isn't really a wiki question but a question of the text editor you use. You might have more look in the comp/tech or windows forum.

    What you can do is use a regular expression to replace "numbers in curly brackets" with "nothing". In the code below, that's done by the ' string = string.replace(/\[\d+\]/g,"")' bit.


    Wordpad doesn't have a regular expression option under edit>replace, so you'll have to use something else to do the replacement. One option is to save this code into a file called removerefs.html or something, and then open it in internet explorer or firefox.
    <html>
    <body>
    <script>
    function display(string){
    	var div = document.getElementById('display');
    	div.innerHTML = string;
    }
    
    function removeRefs(string){
    	string = string.replace(/\[\d+\]/g,"")
    	display(string);
    }
    </script>
    
    <div id="display"></div>
    
    <form>
    <textarea name="content" id=content rows='25' cols='80'></textarea>
    <br />
    <INPUT TYPE="button" VALUE="Remove refs" accesskey="n" onclick="removeRefs(content.value);">
    </form>
    
    </body>
    </html>
    
    Open hughgrant.rtf (the file you made when you saved the wikipedia page in wordpad) in notepad(not wordpad). You'll see a heap of gibberish with some text you recognise. Copy it all into the text box in the html file which is open in your browser, and hit the button or press alt-n. Copy the result back into hughgrant.rtf which is still open in notepad (overwriting), and save it. Open hughgrant.rtf in wordpad and the references should be gone.

    There are other things you can do, but without knowing why you are doing this, it's difficult to guide. Make sure you post back here to say if it worked or not.


Advertisement