Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

make CSV header space insensitive, allow quotes #289

Open
lsloan opened this issue Sep 14, 2020 · 0 comments
Open

make CSV header space insensitive, allow quotes #289

lsloan opened this issue Sep 14, 2020 · 0 comments
Labels

Comments

@lsloan
Copy link
Member

lsloan commented Sep 14, 2020

Copied from tl-its-umich-edu/canvas-course-manager#29. (Opened in wrong repo.)

Spacing problem

When using CCM to create sections via CSV, it would not process the file with these column headings:

id_prefix, name

After I removed the space following the comma, it began processing the rest of the file. The column headings needed to look like:

id_prefix,name

Spaces after commas should not be significant when using CSVs. They should be ignored. Update CCM to ignore spaces after commas. If the user wants a leading space at the beginning of a value, they will need to enclose the value in quotes.

This also applies to the function for "Add multiple users to course sections through CSV". It gives the error message Something is wrong with your file. Bad or missing headers? Should be: "user_id, role, section_id". Note that spaces ARE INCLUDED in the recommended header. However, if that is used, it will give the same error message. It ONLY works when the spaces are removed from the header, like this:

user_id,role,section_id

Quoting problem

As I was working with data from another source, it used quotes around all values in the CSV, including the column headers. This is valid according to CSV standards. The headers were:

"groupset","name","user_id"

However, when this data file was used, CCM gave the error message Something is wrong with your file. Bad or missing headers? Should be: "groupset, name, user_id".

CCM processed the file correctly when I removed the quotes from the headers, giving this:

groupset,name,user_id

Since that's not the way CSV works, that is a bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant