Thursday, February 19, 2015

How to download a decent list of Volcanic acitivity in recent times

1. Open Opera.

I haven't tried this in Firefox but there is no reason why that doesn't work just as well.

2. Load this page:
http://volcano.si.edu/search_eruption_results.cfm
It should open the list of volcanoes but it may not do much more than that for you. It WON'T do any more than that for you if you are using Linux.
(Try telling that to Wikipedia.)

3. Right click on the list.
When you right click on the list it shows, you should be able to view the page code.

It will look something like this:


<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <title>Global Volcanism Program | Eruption Search Results</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
    <script type="text/javascript" src="js/analytics.js"></script>
    <script type="text/javascript" src="js/framej.js"></script>
    <script type="text/javascript....


4. Highlight page from:

<div class="td1"><a href="volcano.cfm?vn=384010">Fogo</a></div>
                                             <div class="td8">Cape Verde Islands</div>
                                            <div class="td3">Confirmed Eruption</div>

                                           

                                            
                                               
    
                                            <div class="td3">2014 Nov 23</div>
                                             <div class="td5"></div>

                                            
                                            <div class="td5"></div>
                                         </div>
                            
                                        <div class="tr">
                                             <div class="td1"><a href="volcano.cfm?vn=341040">Colima</a></div>
                                             <div class="td8">Mexico</div>
                                            <div class="td3">Confirmed Eruption</div>

                                           

to:
...div class="td1"><a href="volcano.cfm?vn=357110">Llaima</a></div>
                                             <div class="td8">Central Chile and Argentina</div>
                                            <divclass="td3">ConfirmedEruption</div>                      
                                               
    
                                            <div class="td3">1997 Mar</div>
                                             <div class="td5">1</div>

5. Copy (CtrlV)

You can now download the copied text to an editor.

6. Get rid of the stuff you don't want.
In my text editor I press CtrlH which gives me the find and replace tool. All text editors have something like that, even Microsoft text editor. You may need to use the File menu to find it.

7. You will probably have to get rid of one line at a time.
Just highlight the line and press the Control and H keys or whatever your system needs:
"  <div class="td5">1</div> " (the bottom line above) contains some data (the number "1") that you want to keep.

This becomes the top line in the "find and replace" box.

8. You want to keep it but you want to keep it separate:
In Linux the script "\t" is used for the "special character" that means "new tab". Put:
\t 1.

Spaces and punctuation marks keep such data as text in spreadsheet files. (that is, in Libre Office Calc on Mageia 4.1.)

9. Click: "Replace All"
You should now have a number one instead of   <div class="td5">1</div>
A line opens at the bottom of the page:

"Found and replaced 267 occurrences"

10. It won't have touched similar lines with different numbers in them.
You could just change the VEI number (that is what the 1 denotes.) You can change it to 2 and repeat and then 3 etcetera. You only need to go to 6 IIRC.

11. You now move onto the next line in the sequence:
                                            <div class="td3">1997 Mar</div>
In this line you waqnt to keep "March 1997".
You want the tab and some punctuation. I use spaces and a full stop:
\t March 1997.

12. Found and replaced 2 occurrences.
It is going to be a long evening. I could just go to the library and use their Microsoft computers and their officeware. Only they use Microsoft Office because someone is stupid or corrupt.

13. I could just go through the months and the years on this thing.
I am not sure what would be quickest. Maybe going to the library. But I will just work up throughthe lines of code and keep it simple and straightforward.

Plus I can stop whenever I want to and give up, as I usually do or continue from the last line.... last time.

14. Learn Bash shell commands and get a life.