Function for data extraction and design from a file (csv or txt) or a database.
data_extraction(
type,
file_path,
database_connection = NULL,
anchor = NULL,
column_name = NULL,
column_type = NULL,
export_path_directory = NULL
)
character expected. Mandatory. Type of process for data extration. You can choose between "csv_txt" or "database".
character expected. Mandatory. File path of the csv, txt or sql file.
list expected. Mandatory for type "sql". By default NULL. Output list from the furdeb database connection functions (like access_dbconnection or postgresql_dbconnection).
list expected. Optional for type "sql". By default NULL. List of values to interpolate in a SQL string query. Each list element have to follow this format: name_anchor = values. Be aware that the values typing format influence the writing of the sql in the query. For example, an integer or numeric value doesn't have any quote, rather than a date or string value.
character expected. Optional for type csv_txt. By default NULL. Column name(s).
character expected. Optional for type csv_txt. By default NULL. Column type(s). You can use the same format that the argument "col_types" of the function read_delim.
character expected. Optional. By default NULL. Directory path associated for the export (in csv).
The function return a tibble.