06-12-2014 11:41 AM
Hi
Im trying to read from cell #14 (means collum #14 ).
Is there a quick way to read only this cell?
Or do I need to read all the cells before him?
tnx.
Adi.
06-12-2014 12:52 PM
I think this depends a bit on what you call 'read'...
If you are reading a file this is a sequential process so you need to read all lines and all columns up to the desired one.
You can sort of hide part of this process by using a scanning function such as ScanFile () or fscanf () which may return only the desired value.
06-12-2014 01:06 PM
06-12-2014 02:26 PM
This is an example for column 4...
You can test it in the Interactive Execution Window
#include <ansi_c.h>
static float result4;
sscanf ( "1.0 2.0 3.0 4.0", "%*f %*f %*f %f", &result4 );
printf ( "%f", result4 );
06-13-2014 10:00 AM
Thanks Wolfgang! You opened me a new world with that asterisk flag! Till now I was always using Scan when I needed to discard part of the scanned string!
Here's where a good basic C course -which I'm missing- comes in handy
06-14-2014 01:15 PM
Had to adapt it to 14 cells, and to strings\int\double veriables...
but it worked 🙂
tnx !!