tim
tim

Reputation: 10176

Notepad++: Capitalize first letter by Shortcut?

I've got a huge list of words (every single word in one line in a txt file) and certain words need to get capitalized manually (e.g. by hand), so I was looking if there's a shortcut in notepad++ (my editor currently) to automatically capitalize the first letter of a line but couldnt find one. Is there none? If not, can you advise me an alternative windows program to quickly do this by using a simple shortcut (so I can go through with the arrow-down key and use the shortcut whenever needed on a specific word)? thanks a lot

Upvotes: 31

Views: 52417

Answers (11)

Rajesh
Rajesh

Reputation: 2155

There is a shortcut available in Notepad++ v7.3.2 to capitalize only the first letter of the selected text:

ALT + CTRL + U

Not sure about prior versions.

Upvotes: 3

Mahmut Aydın
Mahmut Aydın

Reputation: 869

Firstly select the text and use ALT+U shortcut

Upvotes: 3

yaz
yaz

Reputation: 11

first you select the first column by pressing alt+ctrl+shift. After seletion just press ctrl+U keys Problem solved

Upvotes: 1

DigitalNomad
DigitalNomad

Reputation: 1031

For those who have hard time following textual instructions, here is the screenshot. (answer credit to @Placido)

enter image description here

Upvotes: 7

u01jmg3
u01jmg3

Reputation: 730

Have you tried recording a macro and then assigning it to a shortcut?

e.g. Your replacement could be:

Find what:    (\A|[.!?]\s+)(\w+)
Replace with: $1\u$2

Tick 'In selection'

And then navigate to MacroModify Shortcut/Delete Macro... in the top menu and assign a shortcut.


This is the resulting macro that I extracted from C:\Users\%USERNAME%\AppData\Roaming\Notepad++\shortcuts.xml.

It uses the shortcut Ctrl + Shift + C

<Macro name="Capitalise" Ctrl="yes" Alt="no" Shift="yes" Key="67">
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam="(\A|[.!?]\s+)(\w+)" />
    <Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam="$1\u$2" />
    <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
</Macro>

Upvotes: 1

CodeCupboard
CodeCupboard

Reputation: 1585

You can do this quickly in MS Word by highliting the list and then using shift + f3 This will cycle through all-upper, all-lower or first letter caps.

Upvotes: 1

Anon Nymous
Anon Nymous

Reputation: 41

Enable Column Mode in N++ and then select the first column. change case to upper case.

Upvotes: 4

Placido
Placido

Reputation: 1385

This can be easily done if the first letters are latin characters. But this method does not work with non-latin (for example cyrillic) characters. Just press Ctrl+F, enable "Regular Expression" checkbox, and search for

^(.)

replace with (Replace All)

\u\1

". matches newline" checkbox has to be unchecked

Upvotes: 75

Menaseru
Menaseru

Reputation: 11

You can do it quick in an unortodox way, but you'll need TotalCommander.

Create new file with a name containing text you want to capitalize. Select this file in TotalCommander. Press Ctrl+M (Multirename Tool). In "Uppercase/Lowercase" dropdown select "First of each word uppercase".

Under Windows. There is a draw back: filename limits to 255 characters if i'm not mistaken. And some special characters will be ommited (slashes, double quote, etc).

Also similar software like Far should work in the same way I think.

Upvotes: 1

Abner
Abner

Reputation: 101

Well, you can install the TextFX plugin and apply Sentense case. Here you have some tricks (including this one). http://a4apphack.com/featured/tricks-with-notepad

Upvotes: 10

Ygor Henrique
Ygor Henrique

Reputation: 53

  1. Open you file in notepad++
  2. Hit ctrl + F
  3. Click on Replace tab
  4. Put \n[the letter you wanna capitalize] inside "Find what" field
  5. Put \n[the letter capitalized] inside the "Replace with" field
  6. Set the search mode to "Extended"
  7. Hit Replace All button

This will capitalize every first letter of a line. You can modify this method to capitalize under other conditions

Upvotes: 2

Related Questions