Reputation: 9
I have a file where each line has the following format: `%s %f %f \n.
Example:
I want to skip the name of the animals and just get the float values after that. How can I do this?
Upvotes: 0
Views: 516
Reputation: 1380
You don't need a C program for this. Import the file in question to excel and remove the first column [which is the names of animals]. This will leave you with what you want.
Now you can save this file from excel.
Upvotes: -1
Reputation: 251
Just read all data with fscanf(f, "%s %f %f", str, &x, &y);
but do not use str
. Or better use fscanf(f, "%*s %f %f", &x, &y);
Upvotes: 5