mirror of
https://github.com/metafy-social/python-scripts.git
synced 2025-03-25 23:19:51 +00:00
Revert "add csv to json script"
This reverts commit d8f56d0d1c5bf2b001ac6f6ef4d7b29420de4fa1.
This commit is contained in:
parent
d8f56d0d1c
commit
d231afd19d
@ -1,8 +1,9 @@
|
||||
# CSV to EXCEL
|
||||
This simple script will convert CSV file to Json.
|
||||
This is a simple script that lets you convert CSV files to Excel.
|
||||
|
||||
## Usage
|
||||
|
||||
* required pandas package
|
||||
* Use `pip install pandas`
|
||||
* 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`
|
||||
|
@ -1,9 +0,0 @@
|
||||
# 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`
|
@ -1,16 +0,0 @@
|
||||
import pandas as pd
|
||||
import os,json
|
||||
|
||||
def csv_to_json():
|
||||
file = input("Enter csv path: ")
|
||||
df = pd.read_csv(file)
|
||||
name = os.path.basename(file).replace("csv", "json")
|
||||
data = df.to_dict("r")
|
||||
with open(name, "w") as file:
|
||||
json.dump(data,file)
|
||||
|
||||
print(f"file saved at {name}")
|
||||
|
||||
|
||||
|
||||
csv_to_json()
|
Loading…
x
Reference in New Issue
Block a user