Skip to content
Snippets Groups Projects
Commit a30176d3 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Clean output filname (replace all problematic characters instead of just the first one)

parent b7e22e9c
No related branches found
No related tags found
No related merge requests found
...@@ -42,8 +42,8 @@ exportInsuranceContractExample = function(contract, prf = 10, outdir = ".", base ...@@ -42,8 +42,8 @@ exportInsuranceContractExample = function(contract, prf = 10, outdir = ".", base
paste(class(contract), collapse = ", ")); paste(class(contract), collapse = ", "));
} }
cleanname = contract$tarif$name; cleanname = contract$tarif$name;
cleanname = str_replace(cleanname, " ", "_"); cleanname = str_replace_all(cleanname, " ", "_");
cleanname = str_replace(cleanname, "[/:]", "-"); cleanname = str_replace_all(cleanname, "[/:]", "-");
if (missing(basename)) { if (missing(basename)) {
basename = paste(outdir, "/", Sys.Date(), "_", cleanname, sep = ""); basename = paste(outdir, "/", Sys.Date(), "_", cleanname, sep = "");
if (!missing(extraname) && !is.null(extraname)) { if (!missing(extraname) && !is.null(extraname)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment