Add text after every line, multiple entries

扶醉桌前 提交于 2021-02-15 11:27:16

问题


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

enter image description here




回答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:


  1. place ur mouse at the start of the first line in ur list.
  2. Press Alt + "C"
  3. A window gets opened. Enter the text that u want to add under "Text to Insert" and press OK.
  4. 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:

  1. Open search and replace box, in 'find what' field add '$' (meaning the end of line char)
  2. In 'replace with' field use, \r - this will add text after each line
  3. Click on replace All button to insert the new line.

Check the screenshot of the above steps



来源:https://stackoverflow.com/questions/13806355/add-text-after-every-line-multiple-entries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!