Created
December 24, 2018 14:19
-
-
Save HansPeterPfister/aa5df3706a7e935f4a2a191b8efd7b21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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