Managing large CSV files can be challenging. This simple Google Apps Script solution helps by splitting large CSV files into smaller, more manageable chunks, while preserving headers and line breaks.
This is a standalone Google Apps Script that runs entirely within Google Drive.
- Preserves Original Formatting: Retains the new line character used in the original file.
- Header Row Duplication: Ensures each chunk includes the header row for independent usability.
- The CSV file is stored in Google Drive.
- The Apps Script:
- Reads the file.
- Splits it into chunks of N records (customizable).
- Open the Google Apps Script editor.
- Copy and paste the script into the editor.
- Save and authorize the script as needed.
- Specify the input CSV file and desired chunk size in the script.
- Run the script to generate the chunks, which will be saved in your Google Drive.