From fededa9fdf02f09c4c67ad4d252ca48b3ba844d2 Mon Sep 17 00:00:00 2001 From: Rainer Walke Date: Thu, 17 Oct 2019 10:58:08 +0200 Subject: [PATCH] fix grep unicode issue again --- R/GENESISClasses.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/R/GENESISClasses.R b/R/GENESISClasses.R index 13b60c5..c933180 100644 --- a/R/GENESISClasses.R +++ b/R/GENESISClasses.R @@ -403,8 +403,9 @@ readRegDeath <- function(infile) { bb <- scan(infile, what=character(), blank.lines.skip = FALSE, encoding="ANSI", sep="\n") - h2 <- grep(";Insgesamt;m\\xe4nnlich",bb) - f1 <- grep("__________",bb) + h2 <- grep(";Insgesamt;m\\xe4nnlich",bb, useBytes = TRUE) + # 10 x low line \x5f + f1 <- grep("\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f",bb, useBytes = TRUE) f2 <- length(bb) header <- bb[1:h2] @@ -454,8 +455,9 @@ readRegExp <- function(infile) { bb <- scan(infile, what=character(), blank.lines.skip = FALSE, encoding="ANSI", sep="\n") - h2 <- grep(";Insgesamt;m\\xe4nnlich",bb) - f1 <- grep("__________",bb) + h2 <- grep(";Insgesamt;m\\xe4nnlich",bb, useBytes = TRUE) + # 10 x low line \x5f + f1 <- grep("\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f\\x5f",bb, useBytes = TRUE) f2 <- length(bb) header <- bb[1:h2]