get line comma within quotes

I'm reading from a csv file and for the most part its going well until I encounter the following line:

24,BK,Limited Free,ALTICEUSA,Prospect Park,"NORTH BOAT HOUSE, ON THE LAWN ACROSS FROM M-200",40.661197,-73.965252,GuestWiFi

Up until then my code for reading these lines worked

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  while (data_input >> temp_objID) {
			
	data_input >> temp_comma;

	getline(data_input, temp_boro, ',');
	getline(data_input, temp_type, ',');
	getline(data_input, temp_provider, ',');
	getline(data_input, temp_name, ',');
			
	// Source of problem
        getline(data_input, temp_location, ',');

	data_input >> temp_latitude;
        data_input >> temp_comma;

	data_input >> temp_longitude;
	data_input >> temp_comma;

	getline(data_input, temp_ssid);

	cout << temp_objID << "," << temp_boro << "," << temp_type << ","   << temp_provider << "," << temp_name << ","
	  			 << temp_location << "," << temp_latitude << "," << temp_longitude << "," << temp_ssid << endl;

		}


I realize that the problem is that
"NORTH BOAT HOUSE,
gets stopped at the comma and everything else is ruined there.
How do I do it in such a way to ignore the comma within the quotation marks?
Last edited on
Topic archived. No new replies allowed.