/merge-multiple-csv

a python script to merge multiple csv files, merge and remove duplicates if exists

Primary LanguagePython

CSV Merger


Overview

This Python script merges multiple CSV files by appending rows to a single output CSV file. The script also processes each row to reformat the date and filter the columns before merging.

Table of Contents

Prerequisites

  • Python 3.6 or later

Installation

  1. Clone this repository or download the script csv_merger.py.
  2. Make sure you have Python installed, or download it from Python's official website.

Usage

Open a terminal and navigate to the directory containing the script. Then, run the following command:

python csv_merger.py [OPTIONS]

Options

  • -n, --name [FILENAME]: Specifies the name of the output file (default: merged.csv).
  • -d, --delete: Deletes input files after merging (default: False).

Example

Let's say you have a directory input with the following CSV files:

  • file1.csv
  • file2.csv

After running the command:

python csv_merger.py -n "final_version" -d

An output file named final_version.csv will be created in the ouput directory, and the input files will be deleted if the -d flag is set.

Contributing

For contributing to this project, please feel free to open an issue or submit a pull request.

Contact