User Tools

Site Tools


getting_information_from_websites

Getting Information from Websites

CSV formatted files

If information is in a electronic format, as information on Websites is, their is usually no need to key it into a spreadsheet. You should be able to import the information or simply copy from the web page and paste it to anywhere in your spreadsheet.

Because spreadsheets have information in cells when you paste multiple lines of information into a call the spreadsheet assumes you want each line to be on a different row in the spreadsheet. However often the spreadsheet will not know how you want to split the row up into columns. Fortunately a specific standard files format called CSV (Comma Separated Values) can tell what part of imported lines go into which columns and so cells. That is the information within rows are separated by a comma “,”. Sometimes information on web pages can be supplied in a CSV format. Even when it is not, their are other methods for breaking up row information into columns.

Bureau of Meteorology data

The data from the Bureau of Meteorology used in a number of the exercises was obtained using the following method.

NOTE: Is the Bureau of Meteorology changes its web site this procedure may not work as it is described.

  1. click on http://www.bom.gov.au/ to go to the Australian Bureau of Meteorology web site
  2. Under the heading of latest Weather Click on Brisbane
  3. In the Station Name column click on Brisbane
  4. Click on Recent Months at Brisbane
  5. Scroll down the page and under formats click on Plain Text Version.
  6. If you have followed the above you should be presented with a page full of information separated by commas. If you do not try clicking on this http://www.bom.gov.au/climate/dwo/201009/text/IDCJDW4019.201009.csv
  7. Click on any part of the data
  8. Whilst holding down the CTRL Key press the A key.
  9. That is the shortcut for Select All. All the text should be highlighted.
  10. Whilst holding down the CTRL Key presss the C key
  11. That is the shortcut for Copying
  12. If you have not already done so start Open Office Calc and make sure you have a empty spreadsheet.
  13. Click on Cell A1
  14. Whilst holding down the CTRL Key press the V key
  15. That is the shortcut for Pasting
  16. You will most likely find that the information has been placed all in column A, which is not what we want.
  17. Undo the last step with the undo function (CTRL + Z)
  18. From the Edit Menu select Paste Special. It should give you two options. HTML Format and Unformatted text.
  19. Click on Unformatted text and then click on Ok
  20. You should be presented with the Text Import window. Carefully look at all the options.
  21. Most likely the “Separated by” will set to “Tab”.
  22. Click on the “Comma” tick box so that it is ticked
  23. Click on Ok
  24. This time the information is presented in columns

You have learnt how to take CSV data form a web page and have it be presented in columns in Open Office Calc

Election 2010 Results Data

Sometimes it is not necessary to do as much work to get this information into columns as can be seen in the Australian Electrical Commission date example below

  1. Click on the Members Elected [CSV 8KB)
  2. Depending on which Internet Browser you are using and how it is set up you may be asked if you want to open or save the file.
  3. If you can select the option to open the file with Open Office Calc and then click on Ok
  4. Open Office Calc should start and you will be presented with a Text Import window
  5. Click Ok
  6. In may appear that all the information is in Column A. However if you move across to column B you will see that the information is in from column B onwards

NOTE: If you have imported this electoral results data this way it will be in Read Only format meaning that you will not be able to change it. To be able to change it you will have to save the spreadsheet and re-open it again.

Fixed width Data

If the data you want to get in to a spreadsheet is not delimited in some way it if usually known as fixed width. That is there is a fixed amount of space been allocated for each piece of data. Calc has a easy way of specifying that space.

  1. Right Click on this http://www.greig.net.au/geoff/fixedwidth.txt and then click on save link as, to download this data. Note where you save the down loaded file to
  2. Go to where you saved the fixedwidth.txt file and double click on it to open it. It should open in Notepad
  3. Click on any part of the information in Notepad
  4. Whilst holding down the CTRL Key press the C key. (Copy)
  5. In an empty spreadsheet click on A1
  6. Paste the copied data (CTRL + V)
  7. The information went all in to one column. This is not what we wanted to happen
  8. Undo the Paste (CTRL +Z)
  9. From the Edit Menu click on Paste Special
  10. Select unformatted Text and click on Ok
  11. Click on the Fixed Text Radio Button
  12. Notice how the data at the bottom of the window changed? If you did not click on the Separated by radio button and repeat the above step
  13. Point at the ruler (0 ….|….10..) and notice what happens. A vertical line appears on the data.
  14. With the vertical line to the right of the last digit in the date click. What happened. Calc put a line in the data with a red dot at the top of it. This is the method you use to specify how the fixed width data will be broken up into columns
  15. Use the same procedure to separate the numbers. If you make a mistake place the line you can click on it again to remove it.
  16. Click on the ok. What happened? Their should be three columns of data

You have learnt how to import fix width data into columns in a spreadsheet

Hints on importing data into spreadsheets

Information can delimited with characters other then a comma “,” as you may have noticed on the Text Import window in Calc. Additionally a text delimiter character can sometimes be used to distinguish between text and non text information. Calc also allows for this.

If you have trouble getting the information correctly into columns try using different separated by characters or text delimiters. If you can still not get the result you want you could try saving the data in Notepad first and them copy it and Paste Special into Calc.

getting_information_from_websites.txt · Last modified: 2012/12/19 13:34 (external edit)