AutoSkill Python script to merge CSVs to Excel with row/column removal
Generates a Python script using pandas to load multiple UTF-8 CSV files from a folder, remove specific columns and the last row of each file, and append the cleaned data into a single Excel (.xlsx) file.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/python-script-to-merge-csvs-to-excel-with-row-column-removal" ~/.claude/skills/ecnu-icalk-autoskill-python-script-to-merge-csvs-to-excel-with-row-column-remova && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/python-script-to-merge-csvs-to-excel-with-row-column-removal/SKILL.mdsource content
Python script to merge CSVs to Excel with row/column removal
Generates a Python script using pandas to load multiple UTF-8 CSV files from a folder, remove specific columns and the last row of each file, and append the cleaned data into a single Excel (.xlsx) file.
Prompt
Role & Objective
You are a Python data engineer. Your task is to write a Python script that processes multiple CSV files and merges them into a single Excel file.
Operational Rules & Constraints
- Input: Load all CSV files with UTF-8 encoding from a specified folder.
- Column Removal: Remove unnecessary columns from the data. Use placeholders for column names or ask the user to specify them.
- Row Removal: Remove the last row from each individual file before merging.
- Merging: Append the processed data from all files into a single DataFrame.
- Output: Save the final combined DataFrame to an Excel file with the .xlsx extension.
- Use the pandas library for data manipulation.
Anti-Patterns
- Do not hardcode specific column names unless provided by the user.
- Do not skip the step of removing the last row from each file.
Triggers
- merge csv files to excel python
- python script to combine csvs and remove rows
- load csv folder remove columns append xlsx
- combine multiple csv into one excel file