-2

I have CSV files that contain 2 columns of x and y coordinates, that are the positions of particles.

I want to read these files and be able to use the data inside to calculate a function (I mean I want use the coordinates to calculate the pair distribution function g(r)).

I have the algorithm to calculate this function but I need help with how to access the CSV files, and be able to read and use the data inside. I'm new to programing in C, can anyone help?

2
  • Are those coordinates in integer or float format? Can you copy and paste a couple of lines? It's very easy to read a CSV file but need to know if its integer or float data. See fscanf which allows you to read formatted data from a stream/file. Commented Jun 13, 2013 at 12:18
  • float format 258.80435 463.3913 397.07144 437.17346 299.2073 463.42682 387.05814 456.94186 299.2073 463.42682 316.56976 446.77905 399.61627 456.61627 Commented Jun 13, 2013 at 12:20

1 Answer 1

4

You use a library, such as libcsv.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.