I have MD5 file which lists filename and MD5 sum in the following way:MD5 (file14n0001.xml.gz) = 04eb2524d271077ec8f1a0021779b171MD5 (file14n0002.xml.gz) = 07e2b29645e9211cce9daf1ae27e7b99MD5 (file14n0003.xml.gz) = c31cca187a32743441868822b02d83aaI need to parse out only filename and MD5 sum; for example, the desired output is:file14n0001.xml.gz 04eb2524d271077ec8f1a0021779b171file14n0002.xml.gz 07e2b29645e9211cce9daf1ae27e7b99file14n0003.xml.gz c31cca187a32743441868822b02d83aaMy tr (augmented with sed) expression is:tr -d 'MD5() ' | sed 's/=/ /g'But tr part of the expression also delete all 5s in lines so the output isfile14n0001.xml.gz 04eb224d271077ec8f1a0021779b171file14n0002.xml.gz 07e2b2964e9211cce9daf1ae27e7b99file14n0003.xml.gz c31cca187a32743441868822b02d83aaI kindly ask for a pointer how to proceed.
Tuning tr and sed expression
bash;sed;tr
Command:sed -r 's/MD5 .(.*). = (.*)/\1 \2/' filenameOutput:file14n0001.xml.gz 04eb2524d271077ec8f1a0021779b171file14n0002.xml.gz 07e2b29645e9211cce9daf1ae27e7b99file14n0003.xml.gz c31cca187a32743441868822b02d83aa