diff --git a/.gitignore b/.gitignore index e3254c5..1d2496e 100644 --- a/.gitignore +++ b/.gitignore @@ -46,5 +46,4 @@ po/*~ # Folders DPT/ -OPUS/ -OPUS_save/ +OPUS*/ diff --git a/OPUS/Rng02_Rng2630_02.0 b/OPUS/Rng02_Rng2630_02.0 deleted file mode 100644 index 4058c6b..0000000 Binary files a/OPUS/Rng02_Rng2630_02.0 and /dev/null differ diff --git a/OpusData.R b/OpusData.R index 41ead62..d2da862 100644 --- a/OpusData.R +++ b/OpusData.R @@ -1,16 +1,20 @@ #!/usr/bin/env Rscript # Attach packages to workspace, execute with every new session +library("filesstrings") source("ReadOpus.R") # Determine file path path <- commandArgs(trailingOnly = TRUE)[1] file_name <- commandArgs(trailingOnly = TRUE)[2] -file_path <- paste(path, file_name, sep = "") +file_path <- paste0(path, file_name) # Convert opus binary file into dataframe data <- read_opus_univ(file_path, 5) +# Move the file to OPUS_old where it will remain temporarily in case of an error +file.move(file_path, "OPUS_old/") + # Replace last "." with "_", add ".DPT" file_name <- paste0(sub(".([^.]*)$", "_\\1", file_name), ".DPT")