Basically I have a .csv file with similar data structure to the following:
Name | Department | Committees | Years Jack | Finance | Party | 7.0 Jen | Marketing | Risk | 15.0
I would like to be able to create individual markdown files based on the Name column in the .csv and then write into each Markdown file, the (Department)(Committees)(Years) info for each person in this format:
So far I have been able to figure out how to create the individual Markdown files by Name but I cannot figure out how to write the correct data inside the file and format it accordingly.
Code so far:
import pandas as pd import csv data = pd.read_csv("Employee_Directory.csv") names = data.Name.to_list() for n in names: name = n.split(", ") file_name = name(0).replace("n", "") + ".md" new_file = open(file_name, "w+") new_file.write = "" new_file.close() print("Success")
Any help would be greatly appreciated.