mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-23 20:11:10 +00:00
added csv to excel converter
This commit is contained in:
parent
f78dedaf66
commit
f5a4e01371
9
scripts/CSV_to_Excel/README.md
Normal file
9
scripts/CSV_to_Excel/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# CSV to EXCEL
|
||||
This is a simple script that lets you convert CSV files to Excel.
|
||||
|
||||
## Usage
|
||||
|
||||
* 2 packages required pandas and openpyxl
|
||||
* Use `pip install pandas` and `pip install openpyxl`
|
||||
* Add path to your csv file and output excel file WITH EXTENSTION `.csv` and `.xlsx`
|
||||
* Run `python script.py`
|
10
scripts/CSV_to_Excel/script.py
Normal file
10
scripts/CSV_to_Excel/script.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
import pandas as pd
|
||||
|
||||
def makeExcel():
|
||||
df = pd.read_csv('Path to your CSV file.csv')
|
||||
# index and header can be set True or False accoring to needs
|
||||
df.to_excel('Path where save as Excel file.xlsx', index=False, header=True)
|
||||
print('Converted Successfuly')
|
||||
|
||||
if __name__ == "__main__":
|
||||
makeExcel()
|
Loading…
Reference in New Issue
Block a user