microsoft / AzureSMR

AzureSMR is no longer being actively developed. For ongoing support of Azure in R, see: https://github.com/Azure/AzureR
Other
60 stars 43 forks source link

Extracting an excel file with multiple tabs from Azure to R #111

Open stochastiq opened 6 years ago

stochastiq commented 6 years ago

There are 2 methods we’re trying:

    • Excel files with multiple tabs go directly to SQL warehouse rather than blob
    • Point R scripts to SQL tables
    • Put R scripts in Kudu serverless functions
    • Read Excel files from Azure blob with multiple tabs in R
    • Put R scripts in Kudu serverless functions

In this case, we've tried: azureGetBlob(sc, blob = "XXXX', storageAccount = "XXXX", container = "XXX", directory = "XXXX", resourceGroup = "XXXX", type = "text")

and

azureGetBlob(sc, blob = "XXXX', storageAccount = "XXXX", container = "XXX", directory = "XXXX", resourceGroup = "XXXX", type = "raw")

both do not return the file. I guess, how do I read each individual sheet into R then?

stochastiq commented 6 years ago

We worked it out, should be: x<-azureGetBlob(sc, blob = "XXXX', storageAccount = "XXXX", container = "XXX", directory = "XXXX", resourceGroup = "XXXX", type = "raw")

q<-tempfile() f<- file(q, 'wb') writeBin(x, f) close(f)

df<-read.xlsx(q, sheetIndex=2, stringsAsFactors=F)