lnt_rename | R Documentation |
Give proper names to files downloaded from 'LexisNexis' based on search term and period retrieved from each file cover page. This information is not always delivered by LexisNexis though. If the information is not present in the file, new file names will be empty.
lnt_rename(
x,
encoding = "UTF-8",
recursive = FALSE,
report = TRUE,
simulate = TRUE,
verbose = FALSE
)
x |
Can be either a character vector of LexisNexis file name(s), folder name(s) or can be left blank (see example). |
encoding |
Encoding to be assumed for input files. Defaults to UTF-8 (the LexisNexis standard value). |
recursive |
A logical flag indicating whether subdirectories are searched for more files. |
report |
A logical flag indicating whether the function will return a report which files were renamed. |
simulate |
Should the renaming be simulated instead of actually done? This can help prevent accidental renaming of unrelated files which happen to be in the same directory as the files from 'LexisNexis'. |
verbose |
A logical flag indicating whether information should be printed to the screen. |
Warning: This will rename all supported files in a give folder.
Johannes B. Gruber
## Not run:
# Copy sample file to current wd
lnt_sample()
# Rename files in current wd and report back if successful
report.df <- lnt_rename(
recursive = FALSE,
report = TRUE
)
# Or provide file name(s)
my_files <- list.files(
pattern = ".txt", full.names = TRUE,
recursive = TRUE, ignore.case = TRUE
)
report.df <- lnt_rename(
x = my_files,
recursive = FALSE,
report = TRUE
)
# Or provide folder name(s)
report.df <- lnt_rename(x = getwd())
report.df
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.