Me dan el siguiente archivo txt:
#Rutas
R1 5 (34.520418555522845,69.20082090000005) (52.50786264022465,13.426141949999987) (7.406652727545182,12.344585699999925) (-0.18659558628491132,-78.4305382) (40.40051528912146 ,-3.5916460749999635)
R2 8 (58.695433501291085,-96) (35.08690549340541,-103.72339606166992) (-12.055345316962327,-77.04518530000001) (40.40051528912146,-3.5916460749999635) (37.943768420529985,104.13611175000005) (-27.787075486256633,133.28132295) (35.673473752079516,139.71038800000008) (62.88647107195116,61.551173617626986)
R3 5 (17.246400332673307, -19.670602940234403) (4.283635422564345,-74.22403995000002) (51.528868434293244, -0.10159864999991441) (62.88647107195116,61.551173617626986) (37.943768420529985,104.13611175000005)
R4 11 (14.422538164676899,-87.63432239999997) (48.85887766623369,2.3470598999999766)
(24.725939314861463 ,46.822528799999986) (58.695433501291085,-96) (35.08690549340541,-103.72339606166992) (-12.055345316962327,-77.04518530000001) (40.40051528912146,-3.5916460749999635) (37.943768420529985,104.13611175000005) (-27.787075486256633,133.28132295) (35.673473752079516,139.71038800000008) (62.88647107195116,61.551173617626986)
R5 5 (52.76081718996433,8.747611999999986) (-19.051901092806112,29.15280180000002)
(-34.61590069251671,-58.433298449999995) (58.695433501291085,-96) (52.76081718996433,8.747611999999986)
Ahora bien, tengo que leerlo sin los espacios y sin las tabulaciones que incluye pero no consigo filtarlo.
He programado el siguiente operador de entrada:
friend istream & operator>>(istream &is, Ruta &ruta){
string codigo;
Punto p;
string numpuntos;
getline(is,codigo,' ');
ruta.code = codigo;
ruta.puntos.clear();
getline(is,numpuntos,' ');
while((is.peek()!= '\n') && !is.eof()){
if(is.peek() == ' '){
is.ignore();
}else{
is>>p;
ruta.puntos.push_back(p);
}
}
if (!is.eof()){
string linea;
getline(is,linea);
}
return is;
}