This is a Python script that converts specific columns from an Excel file to a CSV file.
- Python 3
- openpyxl library (install using
pip install openpyxl
)
- Ensure that your Excel file is in the same directory as the script.
- Modify the
input_file
variable in the script to specify the name of your input Excel file. - Update the
column_names
list in the script to include the names of the columns you want to extract. - Run the script using
python csv-converter.py
. - The extracted column data will be saved to a CSV file named "output.csv" in the same directory.
- Run the csv output using
python output-view.py
.
Suppose you have an Excel file named "input.xlsx" with the following columns:
Name | Age | Location |
---|---|---|
Thens | 19 | USA |
Kesavan | 23 | UK |
Pradeep | 50 | UAE |
To extract the "Name" and "Location" columns, update the column_names
list as follows:
column_names = ['Name', 'Location']
Name,Location
Thens,USA
Kesavan,UK
Pradeep,UAE