Skip to contents

This function reads all CSV files in a specified directory and writes their contents to separate sheets in a single Excel workbook.

Usage

handle_csv_xlsx(input_path = ".", output_path = "output.xlsx")

Arguments

output_path

A character string specifying the directory and file name to write the xlsx to.

path

A character string specifying the directory containing the CSV files. Defaults to the current working directory (".").

Value

An Excel file named "output.xlsx" containing the contents of the CSV files.

Examples

# Convert CSV files in the current directory to an Excel workbook
handle_csv_xlsx(path = ".")
#> Error in handle_csv_xlsx(path = "."): unused argument (path = ".")

# Convert CSV files in a specified directory to an Excel workbook
handle_csv_xlsx(input_path = "path/to/directory", output_path = "path/with/file/output.xlsx")
#> Warning: There are no .csv files in this directory