Reputation: 3
I have a sample text like this
-message {This is a block with single quotes 'single_quoted_data'(domain 'this_is_the_first_domain(dov vcc:0.897 and vmm)') the next quoted data 'second_single_quoted_data'(domain 'this_is_the_second_domain(dov vcc:0.897 and vmm)') then some more text}
here I want to extract:
single_quoted_data
and second_single_quoted_data
.
Please suggest an optimum way. I tried with grep -o
followed by sed
but it didnt work
Upvotes: 0
Views: 161
Reputation: 133680
@Prash:try:
awk -F"'" '{for(i=1;i<=NF;i++){if($i ~ /quoted_data/){print $i}}}' Input_file
Upvotes: 0