I want to read data of average saturation (%) for water as shown below. This data is a partial form of a large file, however the average water saturation (%) REPEATS itself in the given format only.
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
I was trying to do it by using readline.m function, but unfortunately the position of average water saturation (%) data is not fixed by line number. The line number changes for similar kind of output file for different models.
This is what I was trying to do:
%# 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
Now if my model (ReservoirModel_ExplorWell_CMGBuilder.out
) changes, then the line numbers where the average saturation (%) for water lies in the text file also changes. Thus Sw_LineNo
changes for different models, and I have large number of models.
Please suggest correct way to read all the average saturation (%) for water data.