From 6231e23fb7cd098dc2d70c32f76ca46bec72eab2 Mon Sep 17 00:00:00 2001 From: lizihao-anu Date: Tue, 26 Sep 2023 17:31:43 +0000 Subject: [PATCH] Style code --- 00_Sort_BI_Extracts.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/00_Sort_BI_Extracts.R b/00_Sort_BI_Extracts.R index 43bb4bc55..888ede5b2 100644 --- a/00_Sort_BI_Extracts.R +++ b/00_Sort_BI_Extracts.R @@ -1,5 +1,5 @@ # Define the source directory and financial year pattern -compress_files = FALSE +compress_files <- FALSE source_dir <- "/conf/sourcedev/Source_Linkage_File_Updates/Extracts Temp" pattern <- "-20(\\d{4})\\.csv" @@ -13,7 +13,7 @@ print(stringr::str_glue("Found {length(csv_files)} csv files to process.")) extract_financial_year <- function(filename) { match <- regexpr(pattern, basename(filename)) if (match[[1]][1] > 0) { - financial_year <- substr(basename(filename), match[[1]][1]+3, match[[1]][1] + 6) + financial_year <- substr(basename(filename), match[[1]][1] + 3, match[[1]][1] + 6) return(financial_year) } else { return(NULL) @@ -32,8 +32,8 @@ for (csv_file in csv_files) { } # compress file - if(compress_files){ - cat("Compressing:", basename(csv_file),"\n") + if (compress_files) { + cat("Compressing:", basename(csv_file), "\n") system2( command = "gzip", args = shQuote(csv_file)