Other Programs/Excel unique finder/excel.c
void truncateTable(FILE* fp, FILE* fpTrun)
{
	char c;
	short commaCounter = 0;

	// Skip the first line
	while ((c = getc(fp)) != '\n');

	while ((c = getc(fp)) != EOF)
	{
		if (c == ',')
		{
			commaCounter++;

			// Copy "Hesaba Giren" to fpTrun
			if (commaCounter == 3)
			{
				while ((c = getc(fp)) != ',')
					putc(c, fpTrun);
				commaCounter++;
				putc(',', fpTrun);
			}

			// Copy "Aciklama" to fpTrun
			if (commaCounter == 7)
			{
				while ((c = getc(fp)) != ',')
					putc(c, fpTrun);
				putc(',', fpTrun);
				putc('\n', fpTrun);

				// Skip rest of the first line
				while ((c = getc(fp)) != '\n');

				commaCounter = 0; // reset commaCounter for the next line
			}
		}
	}

}
// This function truncates the data we dont need and puts relevant 
//  data to a new file.
This function truncates the data we dont need and puts relevant
data to a new file.
This function truncates the data we dont need and puts relevant data to a new file .
void truncateTable(FILE* fp, FILE* fpTrun)
{
	char c;
	short commaCounter = 0;
	while ((c = getc(fp)) != '\n');
	while ((c = getc(fp)) != EOF)
	{
		if (c == ',')
		{
			commaCounter++;
			if (commaCounter == 3)
			{
				while ((c = getc(fp)) != ',')
					putc(c, fpTrun);
				commaCounter++;
				putc(',', fpTrun);
			}
			if (commaCounter == 7)
			{
				while ((c = getc(fp)) != ',')
					putc(c, fpTrun);
				putc(',', fpTrun);
				putc('\n', fpTrun);
				while ((c = getc(fp)) != '\n');
				commaCounter = 0; 
			}
		}
	}
}
void truncateTable ( FILE * fp , FILE * fpTrun ) { char c ; short commaCounter = 0 ; while ( ( c = getc ( fp ) ) != ' \n ' ) ; while ( ( c = getc ( fp ) ) != EOF ) { if ( c == ' ' ) { commaCounter ++ ; if ( commaCounter == 3 ) { while ( ( c = getc ( fp ) ) != ' ' ) putc ( c , fpTrun ) ; commaCounter ++ ; putc ( ' ' , fpTrun ) ; } if ( commaCounter == 7 ) { while ( ( c = getc ( fp ) ) != ' ' ) putc ( c , fpTrun ) ; putc ( ' ' , fpTrun ) ; putc ( ' \n ' , fpTrun ) ; while ( ( c = getc ( fp ) ) != ' \n ' ) ; commaCounter = 0 ; } } } }
This function truncates the data we dont need and puts relevant
data to a new file.
This function truncates the data we dont need and puts relevant data to a new file .
// Skip the first line // Copy "Hesaba Giren" to fpTrun // Copy "Aciklama" to fpTrun // Skip rest of the first line // reset commaCounter for the next line