Usage
normalize_hashtags(dir = utils::choose.dir(), tag_line = 1)
Arguments
- dir
(optional) a string indicating the directory of the files. This function will look up just for files, directories will not be affected. (default::
utils::choose.dir()
).- tag_line
(optional) a number indicating the line where the tags are in.
See also
Other file functions:
blank_line_neighbors()
,
normalize_names()
,
remove_blank_line_dups()
,
replace_in_file()
,
split_file()
Examples
file_name <- tempfile(tmpdir = tempfile())
dir_name <- dirname(file_name)
dir.create(dir_name)
file.create(file_name)
#> [1] TRUE
con <- file(file_name, "r+")
data <- c("#tEs43(23)ds #45&$dAAsad-dsade", "", "Test", "")
writeLines(data, con = con)
close(con)
normalize_hashtags(dir_name, tag_line = 1)
con <- file(file_name, "r+")
readLines(con)
#> [1] "#tes4323ds #45daasad-dsade" ""
#> [3] "Test" ""
#> [5] "st" ""
close(con)