I have a file in a specific format (see below), with line breaks and tabs in specific places. What i need to do group it up to 'M END' and then append $$$$ after 'M END' to make it individual elements - im not bothered about the stuff after M END - that can be discarded. I gather i can use a regex for this, but keep hitting problems with line breaks.
File::
-OECHEM 658567-
1 2 0000 V2000
4 \t 5 8.7 7.655 3
2 \t 55 6 4 5
M END
> <compound id>
665765765
> <source>
db1
$$$$
-OECHEM 35343-
3 6 0000 V2000
1 \t 7 6 4.6 9
2 \t 45 0 3 5
M END
> <compound id>
3546789
> <source>
db1
$$$$
Any ideas appeciated.
TIA - Joe
please note that between M and END there is two spaces.
In reply to Regex for matching and appending by joec_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |