I have below text file only with one line:
vi test.txt
This is the first test from a1.loa1 a1v1, b2.lob2, "c3.loc3" c3b1, loc4 but not from mot3 and second test from a5.loa5
Below should be the output that i want:
a1.loa1
b2.lob2
c3.loc3
loc4
a5.loa5
alv1
and c3b1
should be ignore.
The rules would be like below:
1) anything before keyword "from" should be ignore
2) anything after keyword "but" should be ignore if any
so we narrow down to below seach:
"from a1.loa1 a1v1, b2.lob2, "c3.loc3" c3b1, loc4"
and
"from a5.loa5"
1) second sentence after keyword "from" should be ignore if any (example: a1v1 should be ignore)
2) first sentence after the comma would needed (example b2.lob2, c3.loc3 and loc4 are needed)
3) second sentence after the comma should be ignore (example c3b1)
4) any double quotes should be remove (example "c3.loc3" should be output as c3.loc3 - no double quotes)
should have the output as below:
a1.loa1
b2.lob2
c3.loc3
loc4
a5.loa5
I know that this is a bit tricky, but this is required from my application, I would indeed really appreciate if someone could help me on above.
Thanks