i need to get first column alone from a text file. i think it can b done with fread. so pls say how to do it.
Extracting the first column from a file
Collapse
X
-
Originally posted by chandra85i need to get first column alone from a text file. i think it can b done with fread. so pls say how to do it.
If yes then use fgets to read the line and use sscanf to get the first token.
Raghuram -
Hi,
If your columns have a field separator, then you can read the file content character by character, until you reach your field separator.
Here is a Tutorial on reading and writing files in C++Comment
Comment