You can probably search and replace with regular expressions. Or you can split it into pieces. But how exactly that works depends on how your markers look like.
Since you didn't provide any sample data but just a hand-waving description, the answer can only be equally hand-waving.