Skip to content

Commit

Permalink
allow for multiple whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
cjyetman committed Jan 13, 2024
1 parent 16da604 commit 8f027ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/determine_headers.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ determine_headers <- function(filepath) {
num_of_cols <- length(headers)

if (num_of_cols >= 3) {
isin_col <- grep(pattern = "^[[:space:]]?isin[[:space:]]?$", x = headers, ignore.case = TRUE, value = TRUE)
market_value_col <- grep(pattern = "^[[:space:]]?market[._ ]{0,1}value[[:space:]]?$", x = headers, ignore.case = TRUE, value = TRUE)
currency_col <- grep(pattern = "^[[:space:]]?currency[[:space:]]?$", x = headers, ignore.case = TRUE, value = TRUE)
isin_col <- grep(pattern = "^[[:space:]]*isin[[:space:]]*$", x = headers, ignore.case = TRUE, value = TRUE)
market_value_col <- grep(pattern = "^[[:space:]]*market[._ ]{0,1}value[[:space:]]*$", x = headers, ignore.case = TRUE, value = TRUE)
currency_col <- grep(pattern = "^[[:space:]]*currency[[:space:]]*$", x = headers, ignore.case = TRUE, value = TRUE)

if (num_of_cols > 3) {
investor_name_col <- grep(pattern = "investor", x = headers, ignore.case = TRUE, value = TRUE)
Expand Down

0 comments on commit 8f027ed

Please sign in to comment.