On Tue, Oct 01, 2002 at 06:09:33PM +0200, Andre Poenitz wrote: > On Wed, Oct 02, 2002 at 12:57:25AM +0900, Jorgen Johansson wrote: > > Such a scripte would be highly appreciated. > > As I broke it I'd better fix it... > > Make a backup of your LyX and repeat > > perl -pi -e 's:(\\label\{[^}_]*)_([^}]*):\1-\2:g' file.lyx > > up to the maximum number of underscores in a single label. > Tell me if something went wrong.
This will only remove underscores in the labels, not in the references. To replace the reference, use perl -pi -e 's:(\\ref\{[^}_]*)_([^}]*):\1-\2:g' file.lyx