I have a file say "SAMPLE.txt" with following content,
P1 10,9:6/123456 P2 blah blah P1 10,9:5/98765 P2 blah blah P1 blah blah P2
I want a output file say "RESULT.txt" as,
Value1:123456 Value2:98765 Value3:NULL
I need to first fetch content between P1 & P2 part then I want to find value of 10,9*/ which I want to save to another value. Incase some P1--P2 block doesn't contain this value I want to save it as "NULL".
How can I code the above in shell/awk ?
I am very new to scripting.