Re: [R] Converting to subscripts and superscripts

From: Ben Bolker <>
Date: Thu, 31 Jul 2008 13:40:48 +0000 (UTC)

 <naw3 <at>> writes:

> Hi,
> I am reading in a CSV file of chemical reactions where the subscripts and
> superscripts are encoded in angle brackets, like below:
> 2 H<SUP>+</SUP> + 2 O<SUB>2</SUB><SUP>-</SUP>
> Is there a way to convert these to actual sub/superscripts and save them in
> another excel file? I greatly appreciate the help!
> Thanks,
> -Nina

  I don't think this is possible (or at least not easy). What you're really asking for is an Excel filter; seems to me the easiest (?) way to do this would be in Visual Basic, or to do search and replace in your work sheet, replacing <sup>2</sup> with (superscript)2, and so on [it doesn't look like Excel's search-and-replace has a regular expression facility, but if you only have a few worksheets and a limited number of sub- and superscripts (say sub/super 1,2,3,+,-) this shouldn't be too painful ...

  Ben Bolker mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 31 Jul 2008 - 13:48:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 Jul 2008 - 14:33:03 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive