我想读取水的平均饱和度 (%) 数据,如下所示。该数据是大文件的部分形式,但平均含水饱和度 (%) 仅以给定格式重复。
Average Pressure
Total Pore Volume psia 3884.9
HC. Pore Volume psia 3884.9
Average P/Z
Total Pore Volume psia 4457.8
HC. Pore Volume psia 4457.8
Average Saturation %
Oil 84.911
Gas .08873
Water 15.000
Percentage Recovery
Stock Tank Oil .02211
STO as a % of Mobile Oil .02891
Total Gas .02034
Water 62e-12
我试图通过使用readline.m函数来做到这一点,但不幸的是,平均含水饱和度 (%) 数据的位置不是由行号固定的。不同模型的类似输出文件的行号会发生变化。
这就是我想要做的:
%# Reading Water Saturation (Sw) data from output (.OUT) file of reservoir model
Sw_LineNo=[554,968,1120,1272,1424,1576,1728,1880,2032,2184,2336,2488,2640,2792,2944,3096,3248,3400,3552,3704,3856]; % This column vector contains the line numbers of the .out file with Sw values for year 1 till 20
for i=1:size(Sw_LineNo,2)
read_value=readline('ReservoirModel_ExplorWell_CMGBuilder.out',Sw_LineNo(i)); % read_value stores values in form of string
Swav_Data_E_W(i,j)=str2num(read_value(33:38)); % converts the required portion of string (Sw value) to number
end
现在,如果我的模型 ( ReservoirModel_ExplorWell_CMGBuilder.out
) 发生变化,那么文本文件中水的平均饱和度 (%) 所在的行号也会发生变化。因此Sw_LineNo
针对不同的模型进行了更改,并且我有大量模型。
请建议正确的方法来读取水数据的所有平均饱和度 (%)。