Skip to content
Snippets Groups Projects
Commit be0fd2fb authored by Gael  MILLOT's avatar Gael MILLOT
Browse files

release v1.2: README and subtitle_time_shift.R files improved

parent 48fab8db
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ Shift the time of .srt subtitle files ...@@ -39,7 +39,7 @@ Shift the time of .srt subtitle files
### Using a R GUI (graphic user interface, i.e., R or RStudio windows) ### Using a R GUI (graphic user interface, i.e., R or RStudio windows)
1) Open the subtitle_time_shift.R file and set the parameters (2 first lines) 1) Open the subtitle_time_shift.R file and set the parameters (in the "Parameters set by users" section)
2) Open R or RStudio 2) Open R or RStudio
...@@ -92,6 +92,11 @@ Not yet published ...@@ -92,6 +92,11 @@ Not yet published
## WHAT'S NEW IN ## WHAT'S NEW IN
### v1.2
README and subtitle_time_shift.R files improved.
### v1.1 ### v1.1
README file improved. README file improved.
......
#!/usr/bin/env Rscript
#########################################################################
## ##
## subtitle_time_shift.R ##
## ##
## Gael A. Millot ##
## Bioinformatics and Biostatistics Hub ##
## Institut Pasteur Paris ##
## ##
#########################################################################
################################ From
# https://gitlab.pasteur.fr/gmillot/subtitle_time_shift
################################ End From
################################ Aim
# Shift the time of .srt subtitle files
################################ End Aim
################################ Parameters set by users
shift <- -1 # in seconds shift <- -1 # in seconds
in.path <- "C:/Users/Gael/Documents/Git_projects/subtitle_time_shift/dataset/movie.srt" # absolute path of the input file in.path <- "C:/Users/Gael/Documents/Git_projects/subtitle_time_shift/dataset/movie.srt" # absolute path of the input file
################################ End Parameters set by users
################################ Main code
a <- read.table(in.path, sep = "\t", check.names = FALSE, quote = "", comment.char = "", blank.lines.skip = FALSE) a <- read.table(in.path, sep = "\t", check.names = FALSE, quote = "", comment.char = "", blank.lines.skip = FALSE)
out.path <- paste0(sub(x = in.path, pattern = "\\.srt$", replacement = ""), "_shift.srt") out.path <- paste0(sub(x = in.path, pattern = "\\.srt$", replacement = ""), "_shift.srt")
...@@ -17,5 +52,5 @@ f <- a ...@@ -17,5 +52,5 @@ f <- a
f[tempo.log, ] <- sapply(X = e, FUN = function(x = X){paste0(x, collapse = " --> ")}) f[tempo.log, ] <- sapply(X = e, FUN = function(x = X){paste0(x, collapse = " --> ")})
write.table(f, file = out.path, row.names = FALSE, col.names = FALSE, append = FALSE, quote = FALSE, sep = "\t") write.table(f, file = out.path, row.names = FALSE, col.names = FALSE, append = FALSE, quote = FALSE, sep = "\t")
################################ End Main code
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment