Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let
RScript =
"#Define download file #(lf)"
& "URL <- " & """" & SourceURL & SourceFileName & """#(lf)" // URL <- ""https://www.six-swiss-exchange.com/shares/companies/download/issuers_all_en.csv""
& "#Define Destination - use forward slash instead of back slash! #(lf)"
& "mainDir <- " & """" & mainDir & """#(lf)" // mainDir <- ""c:/""
& "subDir <- " & """" & subDir & """#(lf)" // subDir <- ""Power BI/""
& "subDir2 <- " & """" & subDir2 & """#(lf)" // subDir2 <- Securities/""
& "filename <- " & """" & filename & """#(lf)" // filename <- ""issuers.csv""
& "Destination <- paste(mainDir,subDir,subDir2, filename, sep="""")
#Create Destination, if it does not exist
dir.create(file.path(mainDir, subDir), showWarnings = FALSE)
dir.create(file.path(mainDir, subDir, subDir2), showWarnings = FALSE)
#Download the file to destination
download.file(URL, destfile = Destination, method = ""auto"", quiet=FALSE)
# Read CSV into R
MyData <- read.csv(file=Destination, header=TRUE, sep="";"")",
Quelle = R.Execute(RScript),
MyData = Quelle{[Name="MyData"]}[Value]
in
MyData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.