From: Khanh on
For example, I have a txt file name mydata.txt as following:
dummy line 1
dummy line 2
dummy line 3
A =1 B=2 C=3
D=4 E=5
dummy line 4
dummy line 5

How can I read the value of C only?
From: ImageAnalyst on
I'd probably try fscanf(). Or alternatively fgetl() and sscanf().
From: Walter Roberson on
Khanh wrote:
> For example, I have a txt file name mydata.txt as following:
> dummy line 1
> dummy line 2
> dummy line 3
> A =1 B=2 C=3
> D=4 E=5
> dummy line 4
> dummy line 5
>
> How can I read the value of C only?

textscan(). HeaderLines 3. Format '%*[^C]C=%d' . Count 1.