File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ # CSV to JSON Converter
2
+
3
+ ** Approach**
4
+ - import ` tkinter ` , ` csv ` and ` json `
5
+ - create a JSON_file dictionary, each representing a record (row) from the CSV file, with the Key as the column specified.
6
+ - use ` csv.DictReader() ` to read the csv file
7
+ - use ` jsonfile.write() ` to write the data that collected from csv file where ` jsonfile ` contains the .json file path with write mode
8
+
9
+ ** Demostration**
10
+ Sample .csv file :
11
+
12
+ ![ image] ( https://github.com/vamsikrishnarh7/Play-With-Python/blob/main/CSV%20to%20JSON%20Converter/images/sample%20csv%20file.png )
13
+
14
+
15
+ GUI looks like below :
16
+
17
+ ![ image] ( https://github.com/vamsikrishnarh7/Play-With-Python/blob/main/CSV%20to%20JSON%20Converter/images/gui1.png )
18
+
19
+ ![ image] ( https://github.com/vamsikrishnarh7/Play-With-Python/blob/main/CSV%20to%20JSON%20Converter/images/gui2.png )
20
+
21
+
22
+ Output :
23
+
24
+ ![ image] ( https://github.com/vamsikrishnarh7/Play-With-Python/blob/main/CSV%20to%20JSON%20Converter/images/sample%20json%20output.png )
You can’t perform that action at this time.
0 commit comments