Kirix Support Forums

Importing text separated by spaces

Please post any help questions, requests or other feedback here.

Importing text separated by spaces

Postby dcalp on Fri Aug 10, 2007 10:08 am

Hi:
I'm having problems trying to import data from a webpage that doesn't have a table. It is only text separated by spaces. Is there a Strata tool to do this?

Take a look to:

http://www.nber.org/cycles.html

Thanks!

Diego
dcalp
Registered User
 
Posts: 2
Joined: Fri Aug 10, 2007 7:14 am

Re: Importing text separated by spaces

Postby Ken on Fri Aug 10, 2007 10:59 am

In this case, Strata is at the mercy of the web designer. If you toggle to the source view, you'll see that this site, unfortunately, doesn't use correct table syntax to format this table.

I was going to suggest that you could copy and paste the data into rows, and then parse the single column into separate columns using strprt(), but because they are formatted with <br> tags going in columns, there are no "rows" to copy. For instance, if you copy/paste this table into excel, you get one very long column.

The only other option that I can think of is writing a script to parse the data into a table, but that likely is not worth the time.

I did try to play with the data that they offer under "Historical Data" -- but couldn't find that exact table in either the HTML view or the Excel Workbook they offer. Note that if you want to import from the Excel Workbook, you'd need to save it as .xls (it is a .xlw file, which Strata can't read). Also, you'll need to do a bit of data cleanup in Excel as there is a lot of unstructured data mixed with the structured data.
Ken Kaczmarek
Kirix Support Team
User avatar
Ken
Kirix Support Team
 
Posts: 147
Joined: Mon Dec 19, 2005 10:36 am

Return to Strata Help & Feedback