Skip to contents

This function reads the content of a text file from a file path or clipboard, processes the content, and formats it into a character vector suitable for use as an input to various data structures creation functions.

Usage

format_input(con = "clipboard", type = "text", sep = "\n")

Arguments

con

Character string. The connection to the file or "clipboard" to read from the clipboard.

type

Character string. The type of processing to be applied ("text" or "other").

sep

Character string. The separator to be used when concatenating lines.

Value

A character vector containing the processed and formatted content.

Examples

if (FALSE) {
# Read from the clipboard and format as text
formatted_text <- format_input()

# Read from a file path and format as "other"
formatted_other <- format_input("path/to/your/file.txt", "other")
}