Programming

메모장 + +는 모든 줄에 추가

procodes 2020. 3. 3. 23:07
반응형

메모장 + +는 모든 줄에 추가


메모장 ++를 사용하고 있는데 이것을 이해할 수 없습니다.

로 시작하는 수많은 줄이 http있습니다. 모든 줄에 그 앞에 텍스트를 추가해야합니다. 또한 각 줄의 끝에 다른 텍스트를 추가해야합니다. 각 줄은 다르게 끝납니다.

각 줄의 시작과 끝에 텍스트를 추가하는 가장 빠른 방법은 무엇입니까?


다음과 같이하세요:

  1. Ctrl+ H눌러 찾기 / 바꾸기 대화 상자를 불러옵니다.
  2. Regular expression대화 상자 하단 근처 옵션을 선택하십시오 .

각 줄 test시작 부분와 같은 단어를 추가하려면

  1. 입력 ^에서 Find what텍스트 상자
  2. 입력 test에서 Replace with텍스트 상자
  3. 파일의 첫 번째 줄에 커서를 놓으면 모든 줄이 영향을받습니다.
  4. 클릭 Replace All버튼

각 줄 test끝에 와 같은 단어를 추가하려면 :

  1. 입력 $에서 Find what텍스트 상자
  2. 입력 test에서 Replace with텍스트 상자
  3. 파일의 첫 번째 줄에 커서를 놓으면 모든 줄이 영향을받습니다.
  4. 클릭 Replace All버튼

  1. 커서를 첫 줄의 시작 부분으로 이동
  2. Alt+를 누른 상태 Shift에서 커서 down키를 사용하여 선택을 블록 끝까지 확장

이를 통해 모든 줄에 동시에 입력 할 수 있습니다.

나는 위의 솔루션을 발견 여기를 .

정규식을 사용하는 것보다 훨씬 쉽다고 생각합니다.


메모장 ++에는 매우 강력한 편집 기능이 있습니다. (오늘 나는 Sublime Text에서 비슷한 기능을 찾고 있습니다.)하지만 메모장 ++의 경우 마우스를 드래그 할 때 Alt 키를 누르십시오 . 입력 한 내용은 모든 행에서 선택한 열을 대체합니다. 기존 텍스트를 바꾸지 않고 삽입하려면 Alt-Shift를 사용하십시오 .

여기에 이미지 설명을 입력하십시오


여기 내 대답이 있습니다. ');'를 추가하려면 각 줄의 끝에서 나는 'Find What : $'와 'Replace with : \); 당신은 탈출해야합니다;여기에 이미지 설명을 입력하십시오


Replace ( + ) 에서 하나의 정규 표현식을 사용하여 메모장 ++에서 자동으로 수행 할 수 있습니다 (각 줄의 시작 및 / 또는 끝에 텍스트 추가 ).CtrlH

여기에 이미지 설명을 입력하십시오

설명 : 표현 $1교체 입력은 괄호 포함하는 모든 문자 의미 (.*)에서 무엇을 발견 정기적 expressin을.

테스트, 작동합니다.

희망이 도움이됩니다.


메모장 ++을 연 다음 Ctrl+ 를 클릭하십시오 F.

정규식 선택

* 찾을 내용 : "^"(각 줄의 색인을 나타냄- "PREFIX").

다음으로 교체 : "anyText"*

여기에 이미지 설명을 입력하십시오

들어 접미사 각 행 : "$와 ^ 바꾸기"위와 동일한 단계를 수행합니다. 그게 다야.


글쎄, 나는 오랜 시간이 지난 후에 이것을 게시하고 있지만 이것은 가장 쉬운 것입니다.

  1. 모든 줄에 대해 시작 / 확정부터 시작부터 텍스트를 추가하려면 여기를 클릭하고 ALT + C를 수행하면 아래 상자가 나타납니다. 텍스트를 입력하고 확인을 클릭하면 완료됩니다.

    여기에 이미지 설명을 입력하십시오

  2. 모든 줄의 끝에 특정 텍스트를 추가하려면 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!:

See the image here


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.

  1. use the command line cc.gl a to get lines and store in an array named a.
  2. use the command line cc.aal //$a to append after each line, using the contents of array a.

Example
여기에 이미지 설명을 입력하십시오


In order to do it in one go:

  1. Copy and paste the following example text in your notepad++ window:

http:\blahblah.com

http:\blahnotblah.com

http:\blahandgainblah.com

  1. Press Ctrl+H on the notepad++ window
  2. 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.
  3. In the Replace with box type: WhateverFrontText(\1)WhatEverEndText. Here (\1) means whatever text in a line.
  4. Check the check box Wrap around
  5. Search mode: Regular expression
  6. Result:

WhateverFrontTexthttp:\blahblah.comWhatEverEndText

WhateverFrontTexthttp:\blahnotblah.comWhatEverEndText

WhateverFrontTexthttp:\blahandgainblah.comWhatEverEndText

  1. Screenshot of the notepad++ options and result: 여기에 이미지 설명을 입력하십시오

참고URL : https://stackoverflow.com/questions/11003761/notepad-add-to-every-line



반응형