30

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

tim
  • 9,896
  • 20
  • 81
  • 137
  • This might help: http://superuser.com/questions/223016/can-i-search-and-replace-in-a-notepad-macro – paulsm4 Jan 25 '13 at 19:42
  • Actually not, but I did it myself yesterday whcich took me like 2 hours, but nevermind... – tim Jan 26 '13 at 08:08
  • Q: What was your solution? Q: Are you pleased with the solution, and the fact that it only took two hours? Q: If not, had you considered writing an awk script, or a Perl or Java program instead of using Notepad++? – paulsm4 Jan 26 '13 at 18:58
  • I did it manually, so I wasnt pleased but couldnt see an alternative since there's no shortcut for it... – tim Feb 03 '13 at 15:09

11 Answers11

75

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

vahid abdi
  • 9,636
  • 4
  • 29
  • 35
Placido
  • 1,386
  • 1
  • 12
  • 24
10

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

Abner
  • 101
  • 2
  • 2
    TextFX is the easiest solution IMHO. After installing the plugin, simply select all relevant text and then navigate to `TextFX > TextFX Characters > Sentence case` – arkon Dec 05 '13 at 05:41
  • I was looking for "Proper Case", I forgot it was in there – BillyNair Sep 27 '16 at 17:58
7

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

enter image description here

NotepadPlusPlus PRO
  • 987
  • 1
  • 8
  • 21
4

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

  • 1
    Your answer is a bit vague. You've not said *how* to select a column, or *how* to change the case of the selection. – Wai Ha Lee Dec 03 '15 at 03:28
  • 1
    To use column mode, place the cursor where you want to start, hold the alt key, and drag. Or press alt-shift-arrow (didn't try that way). Not useful for the OP it sounds like, but worked for me. – nasch Jun 30 '16 at 21:08
  • I will upvote you answer (+1) because it helped me but WaiHaLee is right, you SHOULD explain HOW to enter column mode and HOW to select the first column (you still can do it by editing your answer, do it!). Thanks @nasch. – Jose Manuel Abarca Rodríguez Mar 07 '23 at 21:58
3

There is a shortcut available in Notepad++ v7.3.2 to capitalize the first letter of a line(Sentence Case).

ALT + CTRL + U

Not sure about prior versions.

Rajesh
  • 2,135
  • 1
  • 12
  • 14
  • 2
    I selected the whole text and pressed the shortcut but only the first line was capitalised. However, it's an interesting shortcut. – Leukipp Jul 01 '17 at 23:36
3

Firstly select the text and use ALT+U shortcut

Mahmut Aydın
  • 831
  • 13
  • 21
  • Doesnt work for me, maybe you have some sort of plugin installed... Base Notepad++ Installation => not possible :) – tim May 13 '20 at 09:03
2
  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

Ygor Henrique
  • 53
  • 1
  • 8
  • Thanks, but that's not what I was looking for. Every word is different and I need to look at it to see if it needs to get capitalized (thus scrolling down the list via the arrow down key) and if so, than I want to quickly do this for this line.... – tim Jan 25 '13 at 20:46
1

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.

Nikos M.
  • 13,685
  • 4
  • 47
  • 61
Menaseru
  • 11
  • 1
1

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>
u01jmg3
  • 712
  • 1
  • 11
  • 31
1

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

yaz
  • 11
  • 1
0

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.

CodeCupboard
  • 1,507
  • 3
  • 17
  • 26