int cell = 1;
int i = 0;
while (i < length) {
if (import[i] == ';' || import[i] == ',') {
cell++;
} else if (import[i] == '\0') {
cell = 1;
} else {
//code
}
i++;
}
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
//...
string s = "one,two,tree;one,two,tree;";
auto cnt = count_if(s.begin(), s.end(), [](char c){ return c == ';' || c == ','; });
cout << "count: " << cnt;
cin.get();
}