Skip to main content
Minor re-tag
Link
AdminBee
  • 23.6k
  • 25
  • 55
  • 77

Extracting parts with specific pattern Selective extraction from patterned occurence (distant repeated lines) using awk or sed where multiple recurrance is happened

I have a question regarding the awk/sed operators. I haveA file which has the following set of lines repeated where the numbersa line is belowpattern where a string line and itthat does not contains numbers occurs twice in the file.

Energy initial, next-to-last, final = 
 -87057.8200168321  -87208.7223900015  -87208.7197287879
Energy initial, next-to-last, final = 
 -87208.7197287879  -87208.7223900015  -87310.7197287879

what I want to do is extract the -87310.71972 value -87310.7197287879 which is the value at the end of the secind occuranceline following the 2nd occurrence of the line that does not contain numbers.

How can some one tell me how toI do this with awk/sed commandsAwk or Sed ?

Extracting parts with specific pattern using awk or sed where multiple recurrance is happened

I have a question regarding the awk/sed operators. I have file which has the following set of lines repeated where the numbers line is below a string line and it occurs twice in the file

Energy initial, next-to-last, final = 
 -87057.8200168321  -87208.7223900015  -87208.7197287879
Energy initial, next-to-last, final = 
 -87208.7197287879  -87208.7223900015  -87310.7197287879

what I want to do is extract the -87310.71972 value which is the value at the end of the secind occurance. can some one tell me how to do this with awk/sed commands?

Selective extraction from patterned occurence (distant repeated lines) using awk or sed

A file has a line pattern where a line that does not contains numbers occurs twice in the file.

Energy initial, next-to-last, final = 
 -87057.8200168321  -87208.7223900015  -87208.7197287879
Energy initial, next-to-last, final = 
 -87208.7197287879  -87208.7223900015  -87310.7197287879

I want to extract value -87310.7197287879 which is the value at the end of the line following the 2nd occurrence of the line that does not contain numbers.

How can I do this with Awk or Sed ?

Source Link
Xdrake
  • 103
  • 3

Extracting parts with specific pattern using awk or sed where multiple recurrance is happened

I have a question regarding the awk/sed operators. I have file which has the following set of lines repeated where the numbers line is below a string line and it occurs twice in the file

Energy initial, next-to-last, final = 
 -87057.8200168321  -87208.7223900015  -87208.7197287879
Energy initial, next-to-last, final = 
 -87208.7197287879  -87208.7223900015  -87310.7197287879

what I want to do is extract the -87310.71972 value which is the value at the end of the secind occurance. can some one tell me how to do this with awk/sed commands?