1st: Please use [ c o d e ] [ / c o d e ] tags!!
A bit lengthy, maybe someone comes up a shorter version:
Code:
cat infile |\
tr -d '\n' |\
sed 's/[^^]RFH/\nRFH/g' |\
sed 's!.*<RequestID>\([^<]*\)<\/RequestID>.*<error:Info>\([^<]*\)<\/error:Info>.*!\1 \2!g'
Both steps are combined. Not sure if you need to loop for the second step, if so, there is no need to loop, as
sed take a stream and checks every single line of input. If you only want step 1 though, just stop after the 1st line of
sed ie. redirect it to a new file or whatever.