Import multiple CSV to GoogleSheet

For Google Sheets, this workflow automates the import of multiple CSV files, ensuring data is cleaned by removing duplicates and filtering for active subscribers. It sorts the data by subscription date and uploads it efficiently, streamlining data management and enhancing productivity.

7/4/2025
9 nodes
Medium
manualmediumreadbinaryfilessplitinbatchesspreadsheetfileitemlistsfiltergooglesheetsfilesstorage
Categories:
Manual TriggeredData Processing & AnalysisMedium Workflow
Integrations:
ReadBinaryFilesSplitInBatchesSpreadsheetFileItemListsFilterGoogleSheets

Target Audience

This workflow is ideal for:
- Marketing Teams: Looking to consolidate subscriber data from multiple CSV files into a single Google Sheet for analysis and campaign management.
- Data Analysts: Who need to clean, filter, and organize data efficiently to derive insights.
- Small Business Owners: Seeking an automated solution to manage customer subscriptions without manual data entry.
- Developers: Interested in automating data processing tasks via n8n and integrating with Google Sheets.

Problem Solved

This workflow addresses the following issues:
- Data Duplication: It removes duplicate entries based on user names to ensure unique subscriber records.
- Data Filtering: It filters out only those users who are subscribed, allowing for targeted marketing efforts.
- Data Organization: It sorts subscribers by their subscription date, making it easier to analyze trends over time.
- Manual Data Entry: Automates the process of importing multiple CSV files into Google Sheets, reducing human error and saving time.

Workflow Steps

Workflow Process Overview:
1. Manual Trigger: The workflow starts when the user clicks "Execute Workflow."
2. Read Binary Files: It reads all CSV files located in the .n8n directory.
3. Split In Batches: The workflow processes each file one at a time, allowing for controlled handling of data.
4. Read CSV: Each CSV file is read into the workflow for further processing.
5. Assign Source File Name: The name of the source file is assigned to the data for reference.
6. Remove Duplicates: Duplicate entries based on the user_name field are removed to maintain data integrity.
7. Keep Only Subscribers: Filters the data to retain only those entries where the subscription status is TRUE.
8. Sort by Date: The remaining records are sorted by the date_subscribed field for better organization.
9. Upload to Spreadsheet: Finally, the cleaned and sorted data is appended to a designated Google Sheet.

Customization Guide

Customizing the Workflow:
- File Selector: Modify the fileSelector parameter in the Read Binary Files node to change the directory or file types you want to import.
- Batch Size: Adjust the batchSize in the Split In Batches node to process multiple files simultaneously if needed.
- Filtering Criteria: Change the conditions in the Keep Only Subscribers node to filter based on different fields or criteria.
- Sorting Fields: Update the sortField in the Sort by Date node to sort the data based on a different column if required.
- Spreadsheet Configuration: Modify the Upload to Spreadsheet node to point to a different Google Sheet or change the operation type to suit your needs.