Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

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

Open
stochastiq opened this issue Jan 22, 2018 · 1 comment
Open

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

stochastiq opened this issue Jan 22, 2018 · 1 comment

Comments

@stochastiq
Copy link

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
Copy link
Author

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant