+
+
+
+
+
# iterate through the list of pages: WATERCUT
+wgr_dfs <- lapply(seq_along(steps_info_txt_pages), function(x) {
+ page <- steps_info_txt_pages[[x]] # put all pages text in a list
+ row_txt <- grep(" WGR=", page)
+ wgr_value <- sub(".*WGR=.*?(\\d+.\\d+).*", "\\1", page[row_txt])
+
+ # dataframe
+ data.frame(wgr = wgr_value, stringsAsFactors = FALSE)
+})
+
+wgr_df <- do.call("rbind", wgr_dfs)
+wgr_df
+
+
+
+
+
+
+
# iterate through the list of pages
+step_info_dfs <- lapply(seq_along(steps_info_txt_pages), function(x) {
+ page <- steps_info_txt_pages[[x]] # put all pages text in a list
+ row_txt <- grep(" STEP", page)
+ date_value <- sub(".*?(\\d{1,2}-[A-Z]{3}-\\d{4}).", "\\1", page[row_txt])
+ # step number
+ step_value <- sub(".*STEP.*?(\\d+)+.*", "\\1", page[row_txt]) # extract the days
+ # get step in days
+ row_txt <- grep(" TIME", page)
+ days_value <- sub(".*TIME=.*?(\\d+.\\d.)+.*", "\\1", page[row_txt]) # extract the days
+ # Get the average pressure PAV
+ row_txt <- grep(" PAV", page)
+ pav_value <- sub(".*PAV=.*?(\\d+.\\d+).*", "\\1", page[row_txt])
+ # get the GOR
+ row_txt <- grep(" GOR", page)
+ gor_value <- sub(".*GOR=.*?(\\d+.\\d+).*", "\\1", page[row_txt])
+ # get the WGR
+ row_txt <- grep(" WGR=", page)
+ wgr_value <- sub(".*WGR=.*?(\\d+.\\d+).*", "\\1", page[row_txt])
+
+
+ # dataframe
+ data.frame(step=step_value, date = date_value, days = days_value,
+ pav_bar = pav_value, gor_m3m3 = gor_value, wgr_m3m3 = wgr_value,
+ stringsAsFactors = FALSE)
+})
+
+step_info <- do.call("rbind", step_info_dfs)
+step_info
+
+
+