Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a long list of words, one word per line. I want to paste cw| before each word on every line. How can I achieve this?

share|improve this question
you don't have to post it twice, correct the punctuation, add some examples as to what you want to do. – Sathya Mar 27 '12 at 11:49

2 Answers 2

If you want to insert text in the beginning of each line try this:

Open Replace dialog (Search->Replace)
    Check "Regular expression" flag in "Search Mode" panel.
    Enter "^(.+)$" (line ending symbol) in "Find what" field.
    Enter "cw|\1" (your text+\1) in "Replace with:" field.
    Press "Replace All"

Regular expressions
You can also run replace in the selection.

share|improve this answer
Thank you so much for your help, it worked a treat. – skok Mar 27 '12 at 12:34

Press control + H, replace ^ with cw|. Make sure you are in regular expression mode.

share|improve this answer
Thanks for the help, it worked. – skok Mar 27 '12 at 12:35
Care to explain how this works? – Ivo Flipse Mar 27 '12 at 13:11
This is using regular expressions. ^ in regular expressions speak means "match start of string". Since you only want to match all start of each line, there is no need to specify anything after the ^. – JackeJR Mar 29 '12 at 9:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.