188. Convert Excel Files with Multiple Sheets to Individual CSV Files
Beginner Mode
Start your terminal to use beginner mode.
Scenario
A directory contains multiple Excel files with multiple sheets that need to be converted to individual CSV files for processing.
Task
Write a Python script at /home/interview/convert_excel.py that reads all Excel files from /home/interview/excel_files/, converts each sheet to a separate CSV file, and saves them to /home/interview/csv_output/ with the naming convention filename_sheetname.csv.
Example
Input:
excel_files/
├── sales_data.xlsx (3 sheets: Q1_Sales, Q2_Sales, Q3_Sales)
└── inventory.xlsx (2 sheets: Electronics, Furniture)
Expected output:
csv_output/
├── sales_data_Q1_Sales.csv
├── sales_data_Q2_Sales.csv
├── sales_data_Q3_Sales.csv
├── inventory_Electronics.csv
└── inventory_Furniture.csv
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Essential
SQL 0/33
Git 0/15
Spark 0/20
Snowflake 0/22
Python 0/24
Need more practice in this area? Explore more questions →
Airbnb
TCS
X
Accenture
Adobe
Google
LinkedIn
Samsung
Datadog
Wix
Dropbox
Meta
OpenAI
Hulu
Uber
DoorDash
Anthropic
Amazon
ActivisionBlizzard
Vercel
Crypto.Com
Zscaler
DeutscheBank
Apple
GoDaddy
BMW
PayPal
Snowflake
AMD
Twilio
Atlassian
JPMorgan
NVIDIA
IBM
Databricks
Coinbase
Cisco
Robinhood
Twitter
Microsoft
Palantir
Netflix
VMware
Cloudflare
Stripe
Capital One
Splunk
Intel
SAP
Tesla
GitHub
JaneStreet
Bloomberg
Salesforce
Elastic
CGI
UBS
GitLab
Ubisoft
Slack
Nintendo
EY
Kayak
Lyft
Walmart
Revolut
Visa
Okta
HashiCorp
Instacart
Mastercard