Skip to content

Combine CSV Files

Combine CSV Files #7

Workflow file for this run

name: Combine CSV Files
on:
workflow_dispatch:
schedule:
- cron: "17 5 * * 2-6" # Runs at 1:17 am ET (5:17 am UTC) from Tuesday (2) to Saturday (6)
jobs:
combine_csv:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set Up Git
run: git config --global user.email "[email protected]" && git config --global user.name "GitHub Actions"
- name: Merge data CSV Files into one and remove the rest
run: |
cat [^c]*.csv > combined.csv
find . -maxdepth 1 -type f -name "*.csv" -not -name "combined*.csv" -exec rm -f {} \;
- name: Rename Combined CSV
run: mv combined.csv "combined_$(date +'%Y-%m-%d').csv"
- name: Commit and Push Changes
run: |
git add .
git commit -m "Merge CSV Files into one and remove the rest"
git push