file_index_search {fabR}R Documentation

Search an index of files

Description

Searches in file index R object (tibble) based on pattern and other query options and provides a table where all the files in a specified folder and corresponding to the query are listed (recursively). If no index tibble is provided, the function creates one from the working directory.

Usage

file_index_search(
  index,
  file_path = "^",
  file_name = "^",
  extension = "^",
  file_type = "^",
  show_tree = FALSE
)

Arguments

index

The index (tibble) of a folder with file locations and metadata, either previously generated by file_index_create() or created from folder.

file_path

A character string specifying a file path to search by. Can be the full string or substring (matching by regex is supported)

file_name

A character string a file name to search by. Can be the full string or substring (matching by regex is supported).

extension

A character string a file extension to search by. Can be the full string or substring (matching by regex is supported).

file_type

A character string a file type to search by. Can be the full string or substring (matching by regex is supported).

show_tree

If TRUE, return the file tree of the query.

Details

The function displays the tree of your files. You can enable this functionality with 'show_tree = TRUE'

Value

A tibble with indexed information for files matching the query.

Examples

## Not run: 

index <- file_index_create(tempdir())
file_index_search(index, file_name = my_file_name)


## End(Not run)


[Package fabR version 2.1.0 Index]