4
votes

Google Sheets importxml() says it can import csv files, but I can't find any examples on how to parse them (just examples on traditional xml files).

Here's my csv target file, and my foolish attempts at an xpath statement.

=IMPORTXML("http://data.gov.au/dataset/b1bc6077-dadd-4f61-9f8c-002ab2cdff10/resource/13ca6df3-f6c9-42a1-bb20-6e2c12fe9d94/download/australianpublicholidays.csv","//a/@href")

I'm a total noob at xpath, so any benevolence appreciated...

Oh and extra points if you can hint out how to transform the 'Date' column in this dataset into a date type column in the Google Sheets in the same xpath query.

1

1 Answers

2
votes

In Google Spreadsheet; you can import csv data with =IMPORTDATA() function.

In your example,

=IMPORTDATA("http://data.gov.au/dataset/b1bc6077-dadd-4f61-9f8c-002ab2cdff10/resource/13ca6df3-f6c9-42a1-bb20-6e2c12fe9d94/download/australianpublicholidays.csv")