search_text | R Documentation |
search for string in text files in a directory
search_text( match_string = "", directory = NA, file = NA, pattern = ".r", pattern_omit = c(NA, "dev_"), recursive = T, clus = NA )
match_string |
string to find within searched files |
directory |
where to search files |
file |
single file |
pattern |
pattern to search for files |
pattern_omit |
pattern to omit searched files |
recursive |
look in subfolders? |
clus |
number of cores, or a cluster object |
search for string in text files in a directory
Revision History
1.0 | 2015 June 19 Created |
two column dataframe like: [1] file matches <0 rows> (or 0-length row.names)
Jacob L Strunk Forest Biometrician(PhD), Statistician (MSc)
makeCluster
list.files
readLines
grepl
test=search_text(directory="//Dnrfsoly107/fr_data/forest_info_1/fris3/R/functions",pattern="[.]r",pattern_omit="dev_",match_string="require(plyr)") print(test) test=search_text(directory="//Dnrfsoly107/fr_data/forest_info_1/fris3/R/functions",pattern="[.]r",pattern_omit="dev_",match_string="library(plyr)") print(test) test=search_text(directory="//Dnrfsoly107/fr_data/forest_info_1/fris3/R/functions",pattern="[.]r",pattern_omit="dev_",match_string="data.table") print(test) test=search_text("c:\\temp\\process_gridmetrics",pattern="2015_Wed_Jul_29_17p01p50.*[.]bat$",match_string = "46896") print(test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.