Is there an R version of Rstudio's 'find in files'?

Viewed 1215

I love Rstudio's 'find in files' function, where you can search for text in all files in a specified directory, but I hate the way to specify the directory to search and types of files, you have to click and point, urgh!

Does anyone know of a simple way of doing this in R console?

2 Answers

I've just done a package for finding a pattern in some files: findInFiles (not finished yet, but soon).

The pattern to search for is a regular expression. You can control the depth of the search and there is an option for case-sensitivity. Results are displayed in the RStudio viewer (actually this is a htmlwidget).

It requires the grep command-line utility, which is always available in Linux platforms; on Windows I think it is installed when you install git.

remotes::install_github("stla/findInFiles")

enter image description here

Related