使用 strsep 拆分包含一堆无用垃圾的 CSV ("," Delim)。其中一个条目的两边都有引号(即Florida,"Bob",1999),我想在将它们保存到我的数组之前将它们拉出来。
如何从名称中删除引号?谢谢!
for (int i = 0; i < 19; i++)
{
token = strsep(©, ","); //Split token
if (i == 3) {one_spot->location = token;}
if (i == 17) {one_spot->name = token;}//the Name is in quotes in CSV
if (i == 18) {one_spot->year = atoi(token);}
}
all_spots[j] = one_spot; //Add to array.