Skip to content

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

Notifications You must be signed in to change notification settings

CarlosUlisesOchoa/merge-multiple-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages