views:

48

answers:

1

I use excel a lot to structure finite state machines. As such I often format cells so that I can cut and past entire sections into my C source directly.

Currently I'm having to preprocess one of my code blocks so that I can replace "-" with "_" in my identifiers. Example, in cell I might have

#define Some-preprocessor-name

But I'd like to have:

#define SOME_PREPROCESSOR_NAME

The upper case bit is covered by UPPER(), but the locations of the hyphens is arbitrary as is the number I'd expect to find. Suggestions?

+2  A: 

You need Substitute().

eg Substitute(A1, "-", "_")

Vicky
That was it. Thanks.
Jamie