Sorry for not replying sooner @mikegdye .
The script currently uses semicolons, but you can just change the two ';' to ',' to get commas. If there are commas in the comments it may be a problem. I'd suggest changing the final line from:
print(a.name + ';' + studentName + ';' + c['comment'])
to something:
print('"' + a.name + '","' + studentName + '","' + c['comment'] + '"')
That will put double quotes around each item (I think importing into Excel can be set to treat anything between double quotes as a single thing and ignore the commas inside double quotes). Of course, this may still be a problem if your comments include double quotes.
If you're using a shell prompt (in Linux or macOS or some unix-like environment in Windows), you can "redirect" the output to a file using the greater than symbol. I'd do a command like:
python GetAllComments.py > comments.csv
The thing after the ">" is just the name of the file to send the output too and could be anything you want. The default location of the new file will be the folder you're terminal is operating in (probably where the script is located).
Most unix-like systems also have a utility called "tee" that can be used to send the output to a file as well as the screen. I often use this to watch the progress of command as well as to store results in a file. It's used with the "|" (pipe) rather than the redirect (the ">"). Something like:
python GetAllComments.py | tee comments.csv
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.