I have an existing csv file "meetingschedule.csv" and into its new column in 'Time' row , I have to add the current time in (%H:%M) format after the 4 columns of given times. But with my code , I am always getting the Time with commas in between:(
Like the Time --> 18:39 would be written as "1,8,:,3,9" as in the following meetingschedule.csv file -
Time,Meeting ID,Passcode
06:47, 999 9722 2425,
16:59, 999 9722 2425,
20:02, 999 9722 2425,
18:08, 999 9722 2425,
1,8,:,3,9
What should I do to fix this issue!? Also, If possible, also provide me the way to insert a comma and copy the Meeting ID from the above row and paste it as per its above lines, followed by a comma (As the Meeting ID also is variable here) after writing the Current_Time .
My Code is Given below--
import datetime , csv
from datetime import datetime
timestr = datetime.now().strftime("%H:%M")
with open("meetingschedule.csv","a") as csvFile:
Fileout = csv.writer(csvFile)
Fileout.writerow(timestr)
For example, I require the output as --
Time,Meeting ID,Passcode
06:47, 999 9722 2425,
16:59, 999 9722 2425,
20:02, 999 9722 2425,
18:08, 999 9722 2425,
18:39, 999 9722 2425,
Thanks For the Help !