#include<iostream.h>
#include<stdio.h>
#include<io.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
void minmax(int);
float max[13],min[13],array[13][270];
void main()
{
FILE *fp;
char line[100];
char symptom[10];
float f;
fp=fopen("input.txt","r");
int i=0,j=0,k,l=0;
int rw_cnt = 0;
int cl_cnt = 0;
int len;
while(!feof(fp))
{
//i=0;
//l=0;
fgets(line,99,fp);
printf("%s \n",line);
// getch();
rw_cnt++;
// len=strlen(line)+;
// line[len]='\0';
//for(i=0;line[i]!='\n';i++)
for (i=0;i<50;i++)
{
while(line[i]!=' ')//&& line[i]=='\n')
{
symptom[j]=line[i];
j++;
i++;
cl_cnt++;
}
symptom[j]='\0';
printf("Symptom= %s \n",symptom);
printf("Symptom = %f \n",atof(symptom));
/*for(int l = 0; l<10;l++)
{
symptom[l]=0;
}*/
j = 0;
}
printf("");
}
cout << rw_cnt;
/*
f=atof(symptom);
array[l][k]=f;
l++;
i++;
j=0;
k++;
printf("array=%d",array[l][k]);
}
*/
I have text file of 270 rows and 13 columns consisting of floating point values.
I want to separate each column separately in the array and find min and max of each array.
Thanks in advance