#' Prefilter log files
#'
#' @description Filter empty or error log files
#'
#' @param path path to logfiles
#'
#' @return NULL
#'
#' @author Marvin Ludwig
#'
#' @export
prefilterLogger <- function(path){
logger_files <- list.files(path, recursive = TRUE, full.names = TRUE)
for(i in seq(length(logger_files))){
cur <- readLines(logger_files[i], n = 40)
if("timestamp;samples;duration;signal_freq;signal_bw;max_signal" %in% cur){
}
headerLine <- grep(pattern="timestamp;samples;duration;signal_freq;signal_bw;max_signal", x=cur, fixed=T)
if(length(headerLine) == 0){
print(paste0("Remove file ", logger_files[i], "\n"))
file.remove(logger_files[i])
}else if(!grepl(";", cur[headerLine + 1])){
print(paste0("Remove file ", logger_files[i], "\n"))
file.remove(logger_files[i])
}
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.