I have a column of text that looks like the following:
nnnnn $xxxx$, nnnnnnn $xxx$, nnn $xxxxxxx$, nnnn $xxxxx$
nnn $xxxx$, nnnnnn, nnnnn $xxxxxxxxxx$
nnnnnnn $xxxxxxxxx$, nnn $xxxx$, $xxxxx$
In other words, the "n" strings and the "$x$" strings can be of any
length and there can be any number of "n" and "$x$" pairs separated by
commas. Also, there is not always a one-to-one correspondence between
the two, i.e. I can have the "n" term without the "$x$" term and vice
versa.
I need a macro that will remove the characters within the dollar signs
(including the dollar signs) and write a new column containing the
remaining characters but excluding any extra commas when there is no "n"
term to go with the $x$ term. |