read_srt {srt}R Documentation

Read a subtitle file as data frame

Description

Convert the SubRip file format to a tabular data frame of times and text.

Usage

read_srt(path, collapse = "\n")

Arguments

path

A path or connection to an .srt file.

collapse

The character with which to separate subtitle lines.

Details

The SubRip format is a newline-separated, non-tabular text file with groups of subtitle text separated by a newline character and preceded by an index and a timestamp string containing the length of the spoken subtitle text. These components (index, time, text) can be parsed individually and combined into a data frame of subtitle groups.

Value

A data frame of subtitles.

Examples

# read linear text to tabular data
read_srt(srt_example(), collapse = " ")

[Package srt version 1.0.4 Index]