Hey! thank you for the tip! I extracted what i need to exactly! For now this will suffice so i can move on with other calculation. But i do want to put it into a loop so it looks cleaner but im not to sure how i'll do that yet. If you have any more tips that would be great! Thank you again
Code:
#include <stdio.h>
#include <math.h>
#include <quadmath.h>
typedef __float128 real;
typedef __float128 doublereal;
#include <stdlib.h>
char line[1500];
int i;
double LDout[80], LDout2[80], LDout3[80];
int main()
{
fptr3 = fopen("Surrogate Run_Finite_Difference_81.in","r"); //Open/Reads file Surrogate Run_Finite_Difference_81.in
fptr4 = fopen("Surrogate Run_Finite_Difference_81.out","w"); //Open/Writes file Surrogate Run_Finite_Difference_81.out
printf("Input:\n\n"); //print to screen
// Reads the LD labels
fscanf(fptr3, "%s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %s %s %s\n", line, LDout, LDout2, LDout3);
fprintf(fptr4,"%s %s %s %s\n", line, LDout, LDout2, LDout3);
printf("%s %s %s %s\n", line, LDout, LDout2, LDout3);
// Reads the Values for LDout, LDout2 and LDout3 from Surrogate Run_Finite_Difference_81.in
for (i=0; i<=80; i++) {
fscanf(fptr3, "%s %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %*lf %lf %lf %lf\n", Doe, &LDout[i], &LDout2[i], &LDout3[i]);
fprintf(fptr4,"%s %.16lg %.16lg %.16lg\n", Doe, LDout[i], LDout2[i], LDout3[i]);
printf("%s %.16lg %.16lg %.16lg\n", Doe, LDout[i], LDout2[i], LDout3[i]);
}