메모장 + +는 모든 줄에 추가
메모장 ++를 사용하고 있는데 이것을 이해할 수 없습니다.
로 시작하는 수많은 줄이 http
있습니다. 모든 줄에 그 앞에 텍스트를 추가해야합니다. 또한 각 줄의 끝에 다른 텍스트를 추가해야합니다. 각 줄은 다르게 끝납니다.
각 줄의 시작과 끝에 텍스트를 추가하는 가장 빠른 방법은 무엇입니까?
다음과 같이하세요:
- Ctrl+ H를 눌러 찾기 / 바꾸기 대화 상자를 불러옵니다.
Regular expression
대화 상자 하단 근처 의 옵션을 선택하십시오 .
각 줄 test
의 시작 부분 에 와 같은 단어를 추가하려면
- 입력
^
에서Find what
텍스트 상자- 입력
test
에서Replace with
텍스트 상자- 파일의 첫 번째 줄에 커서를 놓으면 모든 줄이 영향을받습니다.
- 클릭
Replace All
버튼
각 줄 test
의 끝에 와 같은 단어를 추가하려면 :
- 입력
$
에서Find what
텍스트 상자- 입력
test
에서Replace with
텍스트 상자- 파일의 첫 번째 줄에 커서를 놓으면 모든 줄이 영향을받습니다.
- 클릭
Replace All
버튼
- 커서를 첫 줄의 시작 부분으로 이동
- Alt+를 누른 상태 Shift에서 커서 down키를 사용하여 선택을 블록 끝까지 확장
이를 통해 모든 줄에 동시에 입력 할 수 있습니다.
나는 위의 솔루션을 발견 여기를 .
정규식을 사용하는 것보다 훨씬 쉽다고 생각합니다.
메모장 ++에는 매우 강력한 편집 기능이 있습니다. (오늘 나는 Sublime Text에서 비슷한 기능을 찾고 있습니다.)하지만 메모장 ++의 경우 마우스를 드래그 할 때 Alt 키를 누르십시오 . 입력 한 내용은 모든 행에서 선택한 열을 대체합니다. 기존 텍스트를 바꾸지 않고 삽입하려면 Alt-Shift를 사용하십시오 .
여기 내 대답이 있습니다. ');'를 추가하려면 각 줄의 끝에서 나는 'Find What : $'와 'Replace with : \); 당신은 탈출해야합니다;
Replace ( + ) 에서 하나의 정규 표현식을 사용하여 메모장 ++에서 자동으로 수행 할 수 있습니다 (각 줄의 시작 및 / 또는 끝에 텍스트 추가 ).CtrlH
설명 : 표현 $1
의 교체 입력은 괄호 포함하는 모든 문자 의미 (.*)
에서 무엇을 발견 정기적 expressin을.
테스트, 작동합니다.
희망이 도움이됩니다.
메모장 ++을 연 다음 Ctrl+ 를 클릭하십시오 F.
정규식 선택
* 찾을 내용 : "^"(각 줄의 색인을 나타냄- "PREFIX").
다음으로 교체 : "anyText"*
들어 접미사 각 행 : "$와 ^ 바꾸기"위와 동일한 단계를 수행합니다. 그게 다야.
글쎄, 나는 오랜 시간이 지난 후에 이것을 게시하고 있지만 이것은 가장 쉬운 것입니다.
모든 줄에 대해 시작 / 확정부터 시작부터 텍스트를 추가하려면 여기를 클릭하고 ALT + C를 수행하면 아래 상자가 나타납니다. 텍스트를 입력하고 확인을 클릭하면 완료됩니다.
모든 줄의 끝에 특정 텍스트를 추가하려면 Ctrl + F를 수행하고 바꾸기를 선택하십시오. 아래 상자가 나타납니다. 'find what'에 '$'를 넣고 텍스트에 'replace with'를 입력하십시오. 검색 모드 (왼쪽 아래)에서 'regular expression'을 선택하십시오. 마지막으로 '모두 바꾸기'를 클릭하면 완료됩니다.
"찾을 내용 :"필드에을 입력하십시오 \r
. 이것은 "행의 끝"을 의미합니다. "다음으로 바꾸기 :"필드에 원하는 것을 넣습니다..xml
if you have several lines, and you are aiming to add that text to the end of the each line, you need to markup the option ". matches newline" in the "Search Mode" group box.
Example:
You have a file name list, but you want to add an extension like .xml. This would be what you need to do and Bang! One shot!:
If you have thousands of lines, I guess the easiest way is like this:
-select the line that is the start point for your cursor
-while you are holding alt + shift select the line that is endpoint for your cursor
That's it. Now you have a giant cursor. You can write anything to all of these lines.
Please find the Screenshot below which Add a new word at the start and end of the line at a single shot
To append different text to the end of each line, you can use the plugin ConyEdit to do this.
With ConyEdit running in the background, follow these steps.
- use the command line
cc.gl a
to get lines and store in an array named a. - use the command line
cc.aal //$a
to append after each line, using the contents of array a.
In order to do it in one go:
- Copy and paste the following example text in your notepad++ window:
http:\blahblah.com
http:\blahnotblah.com
http:\blahandgainblah.com
- Press Ctrl+H on the notepad++ window
- In the Find what box type:
^(.+)$
. Here ^ represents the start of the line. $ represents the end of the line. (.+) means any character in between the start and the end of the line and it would be group 1. - In the Replace with box type:
WhateverFrontText(\1)WhatEverEndText
. Here (\1) means whatever text in a line. - Check the check box Wrap around
- Search mode: Regular expression
- Result:
WhateverFrontTexthttp:\blahblah.comWhatEverEndText
WhateverFrontTexthttp:\blahnotblah.comWhatEverEndText
WhateverFrontTexthttp:\blahandgainblah.comWhatEverEndText
참고URL : https://stackoverflow.com/questions/11003761/notepad-add-to-every-line
'Programming' 카테고리의 다른 글
Angular에서 경로 변경을 감지하는 방법은 무엇입니까? (0) | 2020.03.03 |
---|---|
IIS 7.5의 ASP.NET MVC (0) | 2020.03.03 |
Homebrew : 심볼릭 링크를 사용할 수 없습니다. / usr / local / bin은 쓰기 가능하지 않습니다. (0) | 2020.03.03 |
파이썬 프로그래밍에서 탭과 공백 (0) | 2020.03.03 |
좋아하는 Visual Studio 키보드 단축키 (0) | 2020.03.03 |