Other Programs/Excel unique finder/excel.c
void findUniques(FILE* a, FILE* b, FILE* c)
{
	float fp2Number;
	char fp2String[77];

	float fp1Number;
	char fp1String[77];

	// bool flag
	char isUnique = 1;

	while (!feof(b))
	{
		fscanf(b, "%f,", &fp2Number);
		if (fp2Number == 0)
			break;

		fgets(fp2String, 77, b);
		
		while (!feof(a))
		{
			fscanf(a, "%f,", &fp1Number);
			fgets(fp1String, 77, a);

			if (fp2Number != fp1Number)
				continue;
			else if (strcmp(fp2String, fp1String) != 0)
				continue;
			else
			{
				isUnique = 0;
				break;
			}
		}

		if (isUnique == 1)
		{
			fprintf(c, "%f", fp2Number);
			fputs(",", c);
			fputs(fp2String, c);
		}
		isUnique = 1;
		rewind(a);

		// This reset makes sure we dont write the last value twice 
		//  while waiting for input in last line to be finished.
		fp2Number = 0;
		strcpy(fp2String, "");
	}
}
// This function finds the unique rows in b and copies them to c.
This function finds the unique rows in b and copies them to c.
This function finds the unique rows in b and copies them to c .
void findUniques(FILE* a, FILE* b, FILE* c)
{
	float fp2Number;
	char fp2String[77];
	float fp1Number;
	char fp1String[77];
	char isUnique = 1;
	while (!feof(b))
	{
		fscanf(b, "%f,", &fp2Number);
		if (fp2Number == 0)
			break;
		fgets(fp2String, 77, b);
		while (!feof(a))
		{
			fscanf(a, "%f,", &fp1Number);
			fgets(fp1String, 77, a);
			if (fp2Number != fp1Number)
				continue;
			else if (strcmp(fp2String, fp1String) != 0)
				continue;
			else
			{
				isUnique = 0;
				break;
			}
		}
		if (isUnique == 1)
		{
			fprintf(c, "%f", fp2Number);
			fputs(",", c);
			fputs(fp2String, c);
		}
		isUnique = 1;
		rewind(a);
		fp2Number = 0;
		strcpy(fp2String, "");
	}
}
void findUniques ( FILE * a , FILE * b , FILE * c ) { float fp2Number ; char fp2String [ 77 ] ; float fp1Number ; char fp1String [ 77 ] ; char isUnique = 1 ; while ( ! feof ( b ) ) { fscanf ( b , " " , & fp2Number ) ; if ( fp2Number == 0 ) break ; fgets ( fp2String , 77 , b ) ; while ( ! feof ( a ) ) { fscanf ( a , " " , & fp1Number ) ; fgets ( fp1String , 77 , a ) ; if ( fp2Number != fp1Number ) continue ; else if ( strcmp ( fp2String , fp1String ) != 0 ) continue ; else { isUnique = 0 ; break ; } } if ( isUnique == 1 ) { fprintf ( c , " " , fp2Number ) ; fputs ( " " , c ) ; fputs ( fp2String , c ) ; } isUnique = 1 ; rewind ( a ) ; fp2Number = 0 ; strcpy ( fp2String , " " ) ; } }
This function finds the unique rows in b and copies them to c.
This function finds the unique rows in b and copies them to c .
// bool flag // This reset makes sure we dont write the last value twice  //  while waiting for input in last line to be finished.