问题
I'm just looking for a way to quicken the process of adding info after every line in a notepad application.
I've got a notepad file that has many entries, around 1000+ and am looking to find a way to add ,"" after every line however I can't simply search and replace since every line is different than the other. Is there another way to simply add three characters after every line reqgardless of what they are?
回答1:
You can do so by hitting Cntrl+F and then checking regular expression box.And put what you want to replace with what thing. You can put regular expression to find as
\r
and replace it with
"YOUR TEXT"\r
回答2:
Get a good text editor like Notepad++, then use the Find/Replace box. Select Regular Expression radio button in the Search Mode section. Search for $
(which is the end of line token), and replace with whatever text you'd like.
回答3:
- place ur mouse at the start of the first line in ur list.
- Press Alt + "C"
- A window gets opened. Enter the text that u want to add under "Text to Insert" and press OK.
- Apply the same procedure for adding text at the end of all the lines.
回答4:
Replace \r
by ""\r
, using extended search mode (you may use \n
instead of \r
if your file is in UNIX mode).
To add it on a new line after every line, you can replace \r\n
by \r\n""\r\n
(or once again \n
by \n""\n
depending on your line ending).
回答5:
If you aren't particular about notepad++ as text editor, try using Atom. It has an option of multi cursor, through which you can add text to multiple lines effortlessly.
回答6:
Another way, you can try the plugin ConyEdit. Use its command line cc.aal <yourContent>
to append after lines with your content. By the way, it can append different text to each line(push data to an array first, then use the array).
回答7:
The chosen answer didn't work for me on notepad++ on windows, it simply appended the text at the end of the line. Here's what worked:
- Open search and replace box, in 'find what' field add '$' (meaning the end of line char)
- In 'replace with' field use, \r - this will add text after each line
- Click on replace All button to insert the new line.
来源:https://stackoverflow.com/questions/13806355/add-text-after-every-line-multiple-entries