Try strtok() or _tcstok() something like this.
Code:
#include <TCHAR.H>
#include <stdio.h>
main( void )
{
TCHAR string[] = "RED 2132 4365 2341 53 23.0 BLUE 2345 4324 23 35 121 552 432 124";
char seps[] = " ";
char *token;
int Col = 0;
token = _tcstok( string, seps );
while( token != NULL )
{
if(!strcmp(token, "RED"))
Col = 1;
else if(!strcmp(token, "BLUE"))
Col = 2;
else if(Col == 1)
printf("RED %s\n", token);
else if(Col == 2)
printf("BLUE %s\n", token);
token = _tcstok( NULL, seps );
}
return 0;
}