Actually I am using XCODE and g++ now. XCODE just as an editor though. The code is by no means long, I have posted it below.

Code:
#include <stdio.h>
#include <stdlib.h>
#include<unistd.h>

#define NUM_PARTICLES 4000

void givePropPercentages(int num_prop, char *name);

int main(){
	
	int NUM_PROP_RUNS;
	char filename[100],title[20], outfile[12];
	FILE *fptr,*fptr2;
	int count=0, j=0;
	int *arrayPtr;
	float tmp;

	printf("\n Number Of Propensity Runs: ");
	scanf("%d",&NUM_PROP_RUNS);
    printf("\n Name of NQ6_AVG.cpp Output File (12 chars max): ");
	scanf("%s",title);
	printf("\n Enter A Name for the Output File (12 chars max): ");
	scanf("%s", outfile);
	
	for(int i=1;i<=NUM_PROP_RUNS;i++){
		
		sprintf(filename,"%d/%s",1000+i,title);
		printf("Opening %s",filename);
		fptr = fopen(filename,"r");
		
		/*
			This loop figures out how many of our particles actually 
			have crystalline like behavior on average over the whole
			run. This is determined by the condition that the NQ6 value
			be greater then 8.
		*/
		
		for (int k=0;k<NUM_PARTICLES;k++){
		
			fscanf(fptr, "%f",&tmp);
			
			if(tmp>8.0){count++;}
		
		}
		
		/*
			Now we malloc ourselves a array of the correct size to
			store the PARTICLE NUMBERS of those which we dertermined
			to be in fact crystalline.
		*/
		printf("\n\n Count: %d\n\n",count);
		arrayPtr = new int [count];
 
		if(arrayPtr == NULL) { 
			printf("error: not enough memory"); 
			return 1;
		}
		
		rewind(fptr);
		
		for (int k=0;k<NUM_PARTICLES;k++){
		
			fscanf(fptr, "%f",&tmp);
			
			if(tmp>8.0){
				arrayPtr[j]=k;
				j++;
			}
		
		}
		
		fclose(fptr);
		
		fptr2=fopen(outfile,"w");
		if (fptr2 != NULL){
			for(int k=0;k<count;k++){
		
				fprintf(fptr2,"%d\n",arrayPtr[k]);
				printf("%d ",arrayPtr[k]);
			}
		}
		else{perror("oops");}
		
		fclose(fptr2);
	}
		
	givePropPercentages(NUM_PROP_RUNS, outfile);	
	return 0;
}

void givePropPercentages(int num_prop, char *name){

	FILE *fileptr;
	float arry[NUM_PARTICLES];
	char dirname[5], output[12];
	float tmp2;
	
	for (int i = 0; i<NUM_PARTICLES; i++){arry[i]=0;}
	
	    for(int i=1;i<=num_prop; i++){
    	char fn[100];    
        sprintf(fn,"%d/%s",1000+i,name);
        fileptr = fopen(fn, "r");
    	
		if ( fileptr != NULL ) {
            
			while (fscanf(fileptr,"%d", &tmp2) != EOF) {
                int pos = tmp2;
			    if (pos >= 0 && pos < NUM_PARTICLES) {
                    arry[pos]++;
                } 
				else {fprintf(stderr,"Out of range %d\n", pos );}
            }
            fclose(fileptr); // close the file
    	} else {perror("oops");}	
    }
	
	printf("\n\n Name the Prop. Percentage output file (12 chars max): ");
	scanf("%s", output);
	
	fileptr = fopen(output,"w");
	
	for (int i = 0; i<NUM_PARTICLES; i++){
		
		arry[i] = arry[i]/num_prop;
		//printf("%d\n", arry[i]);
		fprintf(fileptr,"%f\n", arry[i]);
	
	}
	
	fclose(fileptr);
}