# Paste letter grades B+ , C-, A, B into notebook and not get B+C-AB

I have worked for two days to find a way through this problem.

I am porting my student grade records into Mathematica from spreadsheets, or sometimes from my college web sites, or sometimes from my word processor. I have many different source formats as you see, but I find I can always get the data into the format where it will paste into a word processor in one or the other format sketched in my subject line above.

I can deal with the Mathematica end of the project once the grades are in the form List["B+", "C-", "A", "B"] -- from there convert them into gpa's, points, sums, averages, whatever -- but I have not been able to operate on the data Pasted into Mathematica because the pluses and minuses are interpreted as parts of incomplete expressions, which blocks execution of string functions.

To get the data in, I need to use use the Windows Copy command, then Paste into Mathematica. The source can easily be one of the two character formats shown just below. (Or see my subject line.) But unfortunately the grades often have pluses and minuses, especially B+ or C+.

But if I paste the following example straight into List in an Input cell, it is interpreted as an incomplete expression:

List[D+, F , C-, F, A-, B, A, A- ,D-, B-, C-, B, D-, D, B, D, A+, B, D, B+, F, C-, F, C+, D-, D+, B]


The same thing happens if I paste the same information in this way:

List[D + F C - F A - B A A - D - B - C - B D - D B D A + B D B + F C - F C + D - D + B]


So I need a "container" to paste into, which will eliminate white spaces, attach any pluses or minuses to the preceding character, and interpret each letter grade as a string as here: List["B+", "C-", "A", "B"] (By the way the only letters which appear are ABCDFWI, if that permits simplification, and the only non-letters are + and -).

• Why not just Import the Excel file directly into Mathematica? You get an array identical to that in your spreadsheet. – user12911 Mar 11 '14 at 11:48
• Some grades are copied and pasted from a university website, also my spreadsheets are so large, with so many sheets and formulas and cells without data, that my computers all hang when I attempt the Import. This is an issue I may give to the stackExchange at some point.... – GeofAndron Mar 11 '14 at 14:55

s = "D+,F,C-,F,A-,B,A,A-,D-,B-,C-,B,D-,D,B,D,A+,B,D,B+,F,C-,F,C+,D-,D+,B";