Page 1 of 1

Change to Title case

Posted: Tue Jun 10, 2008 5:13 pm
by prashob12
Hi All,

I have certain attribute values, see the following example:

bez="vergabekammer baden wurttemberg"

Here i want to change the attribute values to Title case.
I can change the above to upper & smaller case using regex like:

Find: "([^"]+)"
Replace: \U\1 or \L\1

But how should i change to Title case, done tell me about macros as there are many files....

Thanks in advance
Prashob

Posted: Tue Jun 10, 2008 9:14 pm
by gan
I'm not sure if i know exactly what you mean by title case, but i assume you want all the words inbetween the " to have the first letter in uppercase and the rest in lower case. Also since you only provided one line of example i assume the rest of the lines is pretty much the same.

You could try this one that works for your current example. If it doesn't work for other lines or change some lines that should not be changed then please provide some more lines as example where you include the lines where it's not working as expected.

Search for:

Code: Select all

("[a-zA-Z])([a-zA-Z]+)|( [a-zA-Z])([a-zA-Z]+)
and replace with:

Code: Select all

\U\1\L\2

Posted: Wed Jun 11, 2008 3:52 am
by prashob12
I want it to be in Title Case for eg:

Input:

bez="rechtsprechung zum baugenehmigungsverfahren"

bez="einwendungen des nachbarn"

Output should look like this:

bez="Rechtsprechung Zum Baugenehmigungsverfahren"

bez="Einwendungen Des Nachbarn"

I want to change the "small case" to "Title case", i think i am clear this time......

Posted: Wed Jun 11, 2008 7:55 am
by gan
The example i gave you is supposed to do exactly what you want and your further explanation make no doubt what you mean by title case. Did you try a search and replace using the example provided and what is the result?

Posted: Sat Jun 21, 2008 3:20 am
by webwiz
1. Highlight the text

2. Press Ctrl-Shift-U

... or from the menu: Edit > Change case > Capitalize

Posted: Sun Jun 22, 2008 12:21 pm
by gan
webwiz wrote:1. Highlight the text

2. Press Ctrl-Shift-U

... or from the menu: Edit > Change case > Capitalize
That will work if ok to capitalize ALL words. As described by prashob12 it seems like the goal is to capitalize the words between the " only. Highlighting could be a pain since there is a lot of files according to prashob12.