Click here to Skip to main content
15,919,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If I have a csv file that contains

How to read these data and store the alphabet before the comma in an array, and the alphabet after the comma in another array. such as [a,b,c,d,e,....][z,y,x,w,....]

Thank you.

What I have tried:

I used fopen("filename", "r"), and fgetc() to get the data, but it didn't work.
Updated 7-Feb-21 19:00pm

1 solution

You can use fgets to read an entire line of text at a time and then strtok to separate the characters.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900