I have a number of txt (*.log) files containing lines of this type:
...
Mismatched '9:132170673': f[G,T] = [0.32,0.68]
Mismatched '9:132228706': f[C,T] = [0.27,0.73]
Possible strand flip for '9:132280822': f[C,G,T] = [0.16,0.00,0.84]
...
I am trying to extract the string number:number between the quotation marks. FROM THE COMMAND LINE!
I can manage it with with a script but would like to understand how to do it from the command line. There must be an easy way!
I have been trying the obvious solutions, for example:
perl -ne 'if (/Possible/ or /Mismatch/) {/'(\S+)'/ ;print "$1\n";}' *.log
perl -ne 'if (/Possible/ or /Mismatch/) {/\'(\S+)\'/ ;print "$1\n";}' *.log
Both gets this answer from UNIX:
-bash: syntax error near unexpected token `('
I also tried to split on the /'/ with the -F option got the same error.
How do I escape the ' inside the command line?