Let's say i have a file filled with random characters with whitespaces and \n included also random.

I want to look for this groups of chars, example: UU, II, NJ, KU. So the purpose is to read the file, look for this kind of groups and say how many are they in the file.

My problem is whitespace and \n, becase if i find one of these i should skip it and search again for the groups. I found a solution that could help me, the function **strtok\_r** . 

<http://www.codecogs.com/reference/computing/c/string.h/strtok.php?alias=strtok_r>

i think this will isolate full strings so i can read one at time.

Is it a good solution or should take other approach?