Expand description
Quick utility to vertically stack a bunch of CSV files with partially matching column headers.
Can be configured using Config.toml to define 3 parameters:
- csv_dir_path: the path to the directory where the csvs you want to stack are held.
- outfile: the filename to write the stacked csv out to.
- colnames: a list of column headers you want to select for in the stacked csv file.
Structs§
- Config
- Config struct representing a few config variables for the app.
Functions§
- build_
df_ vec - Takes a Vec of csv filename strings and returns a Vec of LazyFrames.
- colnames
- Reads a plain text file with lines containing the column names desired to be selected for the final stacked CSV.
- csv_
filenames - Lists all CSV files in the csv_dir_path argument directory and returns the list as a Vec.
- read_
single_ csv - Reads one CSV file into a Polars LazyFrame.
- run
- Main function to run the crate binary.
- stack_
dfs - Takes a Vec of individual dataframes and returns a stacked dataframe, with columns selected from the colnames argument.