Working with .csv and strange symbols being inserted

Hey,

I am working on a program that reads in a .csv file. One of the files requires the data to be split into two different variables. I am having trouble with my vector ShiftList. The code that assigns values to ShiftList is below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
vector < vector <int> > LoadShiftBidResults (vector <Guard> ParticipationList, vector <string> &ShiftList)
{
	// Variables
	string filename, shift, name, ColumnHeader, input;
	int preference, number_of_unique_shifts(101), number_participating(ParticipationList.size());
	vector < vector <int> > ShiftBidResults(number_participating, number_of_unique_shifts);
	ifstream ShiftBidResultsFile;

	cout << "\nWhat is the name of the file that contains the shift bid results that you will load into the\nprogram? (i.e. shiftbidresults.csv)" << endl;
	getline(cin,filename);

	ShiftBidResultsFile.open(filename);

	// This is needed because the first input is a column headers
	getline(ShiftBidResultsFile, ColumnHeader, ',');

	// Load the names of the unique shifts
	for (unsigned i = 0; i < number_of_unique_shifts; i++)
	{
		getline(ShiftBidResultsFile, shift, ',');
		ShiftList.push_back(shift);
	}

	// Load the shift bid results for each guard. The position will be found from the Guard information (shift_bid_location).
	for (unsigned i = 0; i < number_participating; i++)
	{
		for (unsigned j = 0; j < number_of_unique_shifts; j++)
		{
			// It is necessary to check for blanks. If a blank is read in, then a value of 0 will be given. If an int is read in, then that value will be assigned.
			preference = 0;
			getline(ShiftBidResultsFile, input, ',');
			
			stringstream ss(input);
			ss >> preference;
			
			ShiftBidResults[i][j] = preference;
		}
	}

	return ShiftBidResults;
}


When I print the values of ShiftList, I get the following output (Note: This is just a portion):

MON 1830-2130
MON 2000-0000
MON 2100-0000
MON 2130-0030
MON 0030-0200
TUES 0400-0630
TUES 0630-0930
TUES 0630-1030
TUESá0645-1030
TUESá0800-1200
TUESá0930-1330
TUESá1030-1430
TUESá1200-1600
TUESá1330-1730
TUESá1430-1830
TUESá1600-1830
TUESá1600-2000
TUESá1730-2130
TUESá1830-2130
TUESá2000-0000
TUESá2100-0000
TUESá2130-0030
TUESá0030-0200
WED 0400-0630
WEDá0630-0930
WED 0630-1030
WEDá0645-1030
WEDá0800-1200
WEDá0930-1330
WEDá1030-1430
WEDá1200-1600
WEDá1330-1730
WEDá1430-1830
WEDá1600-1830
WEDá1600-2000
WEDá1730-2130
WEDá1830-2130
WEDá2000-0000
WEDá2100-0000
WEDá2130-0030
WEDá0030-0200
THU 0400-0630
THUá0630-0930


I should not be getting the a's with the dash over them. Has anyone ever encountered this problem before? Or does anyone know how to deal with it? Thanks for any help!
Topic archived. No new replies allowed.