Hello,
the way I did that might be not totally uninteresting.
First I copied all links (the page) from here
http://www.processing.org/reference/
I copied it into Word and made a file of all hyperlinks with this vba-code:
- Sub GetAllHyperlinksInTheFile()
-
- Dim hl
- Dim result
-
- For Each hl In ActiveDocument.Hyperlinks
-
- result = result & hl.Address & vbNewLine
-
- Next
-
- Documents.Add
- ActiveDocument.Range.InsertAfter result
-
- MsgBox "done"
- End Sub
This list looks like
Now I wrote a program in processing (see below) to load all those pages, take the middle part
from it (that is all between
- "If you prefer a more technical reference, visit the" and
- "Updated on"
) and write it in a text file.
This text file I loaded into Word and
inserted page numbers and a table of contents there.
That is what you see in the dropbox link above.
Greetings, Chrisir
P.S.
The program that reads the list of links and merges it into one file:
- PrintWriter output;
- String weblinks [] = loadStrings("list.txt");
- String linesInCurrentPage[];
- boolean beginrecording; // flag
- //
- //
- // Create a new file in the sketch directory
- output = createWriter("result1.txt");
- println("there are " + weblinks.length + " weblinks");
- //
- // loop over all linesInCurrentPage with the web-links
- for (int i2 = 0 ; i2 < weblinks.length; i2++) {
- println(weblinks[i2]);
- //
- if (weblinks[i2].length()>0) {
- linesInCurrentPage = loadStrings(weblinks[i2]);
- beginrecording = false;
- for (int i = 0 ; i < linesInCurrentPage.length; i++) {
- println("##"+linesInCurrentPage[i]+"##");
- if (beginrecording) {
- // start-string
- if (linesInCurrentPage[i].indexOf("Updated on")>-1) {
- // set flag to stop
- beginrecording = false;
- } // if
- else
- {
- // append linesInCurrentPage[i]
- // Write the coordinate to the file
- output.println(linesInCurrentPage[i]);
- //
- } // else
- }
- // start-string
- if (linesInCurrentPage[i].indexOf("If you prefer a more technical reference, visit the")>-1) {
- // set flag to start
- beginrecording = true;
- }// if
- }//for
- // mnake a line after one page is finished
- output.println("");
- output.println("---------------------------------------------------");
- output.println("");
- } // if
- } //for
- //
- // when list of links in done, close file
- output.flush(); // Writes the remaining data to the file
- output.close(); // Finishes the file
- // ------------------