//﻿Name,Symbol,Last price,Change
//"Xilinx, Inc.",XLNX,21.34,-0.31,
//"Elan Corporation, plc (ADR)",ELN,7.05,-0.06,

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

void title() {
        printf("\ta product of the linuxsociety team and licensed under GPLv3\n");
        printf("\tThis is version 0.0.1 dated 09/02/2009\n");
        printf("\n");
return;
}

void usage() {
        printf("Usage:\n");
        //printf("\n");
        printf("\n");
}




int main(int argc, char **argv)
{
        int i;
	int linenumber=0;
	double lastprice, change;
	double perchange;
	FILE* list1;
	char linestring[1000];
	char copystr[1000];
	char companyname[500];
        char *token;
        char *line;
        char *search = " ";


        if( ( list1 = fopen( "list1.csv", "r" ) ) == NULL ) {
                fprintf( stderr, "Error opening list1.csv\n" );
                exit( 1 );
        }
        while( fgets(linestring, sizeof(linestring), list1) != NULL)
        {
		if(linenumber != 0)
		{
			//strcpy(copystr, linestring);
			//pull company name out, and remove first comma
			



			//separate by commas and assign values to variables
			token = strtok(copystr, search);
			token = strtok(NULL, search);
			lastprice = atof(temp);

			change = atof(temp);




		}
	}



//print average % change

//print # ups/downs/unchanged

//print tiered display 
//-400%+ -200%+ -100%+ -50%+ -25%+ -15%+ -10%+ -5%+ -1%+  
//(not greater than 1 or same)   
//1%+ 5%+ 10%+ 15%+ 25%+ 50%+ 100%+ 200%+ 400%+

//print the name of the top 5 gainers/losers

return 0;
}
