Используя perl, вы можете сделать следующее. Он захватывает числовое значение после minimum:
внутри блока Channel Statistics:
и печатает его:
perl -0 -ne '/Channel Statistics:\s+Gray:\s+Minimum:\h+([\d.]+)/ && print $1,"\n"' file
Вывод: (для данного примера)
255.00
Объяснение:
-0 # specifies the input record separator. If there are no digits, the null character is the separator. The whole file is read in a single string. -n # Iterate over the file -e # execute the command line
Regex:
/ # regex delimiter Channel Statistics: # literally \s+ # 1 or more any kind of spaces Gray: # literally \s+ # 1 or more any kind of spaces Minimum: # literally \h+ # 1 or more horizontal spaces ( # start group 1 [\d.]+ # 1 or more digit or dot ) # end group / # regex delimiter