write_lnes_after_deleting_selected_comments: Writes lines (contents of a file minus comments) to a new...

View source: R/write_files_after_deleting_selected_comments.R

write_lnes_after_deleting_selected_commentsR Documentation

Writes lines (contents of a file minus comments) to a new file.

Description

Writes lines (contents of a file minus comments) to a new file.

Usage

write_lnes_after_deleting_selected_comments(
  original_file,
  new_file,
  label,
  isolated,
  overwrite
)

Arguments

original_file

Character vector of length one indicating the file with comments being removed

new_file

Character vector of length one indicating the revised file after removal of comments.

label

Optional regex expression that can be used to limit the comments found by adding each element of the character vector in turn immediately after "<!–" in the regex expression. The resulting logical vectors are OR'd together to combine their results.

isolated

Logical value indicating that the comment is the first text to appear on the line.

overwrite

logical; should existing destination files be overwritten?

Value

NULL

Reads the original_file and deletes HTML comments that have the content of the label detected. It then writes the modified lines out to the new_file.


rmsharp/rmsutilityr documentation built on Feb. 13, 2024, 6:01 p.m.