├── .idea ├── .gitignore ├── inspectionProfiles │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── searching a CSV file.py.iml └── vcs.xml ├── Python 1-2 ├── Finalproject.py ├── System.csv └── demo.gif └── README.md /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/searching a CSV file.py.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Python 1-2/Finalproject.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Write a program, which can read 'System' csv files and return relevant information for a particular event id. 3 | [The program should provide an option where user can enter a event id and its relevant information are retrieved from the csv file] 4 | ''' 5 | import csv 6 | data=[] 7 | with open("System.csv") as csvfile: 8 | reader = csv.reader(csvfile) 9 | for row in reader: 10 | data.append(row) 11 | #print(data) 12 | 13 | Event_ID=input("Enter the event_id..") 14 | 15 | col=[x[3] for x in data] 16 | #print(col) 17 | if Event_ID in col: 18 | for x in range(1,len(data)): 19 | if Event_ID==data[x][3]: 20 | print(data[x]) 21 | else: 22 | print("Opps ☹! Sorry There is No Event_ID like this please check it once and try again later. Thank you !😎") 23 | -------------------------------------------------------------------------------- /Python 1-2/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kushal997-das/Searching-a-CSV-file-using-python/b57ca9895811d0f9719ff8fc31355ab4648634ad/Python 1-2/demo.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Problem statement : 2 | 3 | ## Write a program, which can read 'System' csv files and return relevant information for a particular event id. 4 | [The program should provide an option where user can enter a event id and its relevant information are retrieved from the csv file] 5 | 6 | 7 | Tasks: 8 | 9 | - Download the 'System' csv file from windows machine. Go to 5:35 to see the System file location.https://www.youtube.com/watch?v=X0WDzktpr5I. 10 | - Open and look at the files and look at how it is structured. 11 | - Write a program which takes event id as input and returns all the data related to that event id. 12 | 13 | **Remember:** 14 | 15 | - These Points- 16 | 17 | - There can be multiple rows for the same event id.
18 | - You should return data for all the rows associated with the input event id. 19 | 20 | 21 | ### Here is how to download the windows system data logs excelsheet. 22 | 23 | 24 | 25 | - If you are using windows system then, go to desktop press window + r key ,one run menu open.
26 | - Type 'eventvwr' in that run menu and then press 'ok' button.
27 | - A 'Event viewer' open and ,then go to the 'Windows Logs' expand it.
28 | - Right click on the 'System' file ,then click 'Save all event as..
29 | - Choose 'Save as type: 'CSV(Comma separated) format.
30 | ## Note: 31 | 32 | - Look at the video https://www.youtube.com/watch?v=X0WDzktpr5I, on how to reach 'System' and save it in your system. 33 | 34 | 35 | ## CSV file 👇 36 | 37 | - [System.csv](https://github.com/Kushal997-das/Searching-a-CSV-file-using-python/blob/master/Python%201-2/System.csv)

38 | 39 | 40 | 41 | 42 | 43 | ## Solution 👇 44 | 45 | - [Solution.py](https://github.com/Kushal997-das/Searching-a-CSV-file-using-python/blob/master/Python%201-2/Finalproject.py)
46 | 47 | 48 | 49 | GIF

50 | 51 |

52 | Let's connect! Find me on the web. 53 | 54 | [][Youtube] 55 | [][gmail] 56 | [][LinkedIn] 57 | [][Github] 58 |
59 |


60 | 61 | [youtube]: https://www.youtube.com/channel/UCIHj6mNCMnSnmWLHOxzIESw?view_as=subscriber 62 | [gmail]: mailto:daskushal980@gmail.com 63 | [linkedin]: https://www.linkedin.com/in/kushal-das-7337421a9/ 64 | [github]: https://github.com/Kushal997-das/ 65 | 66 | 67 | 68 | 69 | If you have any Queries or Suggestions, feel free to reach out to me. 70 | 71 |

Show some  ❤️  by starring some of the repositories!

72 | 73 | 74 | 75 | 76 | --------------------------------------------------------------------------------