이것은 파일의 일부 텍스트 줄입니다. vi 편집기를 사용하여 특정 텍스트 블록을 제거해야합니다.Vi 편집기에서 여러 줄 바꾸기
오로라 (복수형 : 오로라 또는 오로라)는 고하 중 (북극 및 남극) 지역의 자연광 디스플레이로, 고하 중 분위기의 원자로 정력적 인 하전 입자가 충돌하여 발생합니다).
Most aurorae occur in a band known as the auroral zone[2][2] which is typically 3° to 6° in latitudinal extent and at all local times or longitudes.
The auroral zone is typically 10° to 20° from the magnetic pole defined by the axis of the Earth's magnetic dipole. During a geomagnetic storm, the auroral zone will expand to lower latitudes. The diffuse aurora is a featureless glow in the sky which may not be visible to the naked eye even on a dark night and defines the extent of the auroral zone.
나는 위와 같은 입력 파일이 있습니다. 이 파일에서 다음과 같은 텍스트 블록의 특정 항목을 제거해야합니다. 나는 끝에 중반와 경도에있는 대부분의, 오로라로 시작하는 라인을 삭제하고
:g/^Most/,/auroral/,/longitudes./d
:
Most aurorae occur in a band known as the auroral zone[2][2] which is typically 3° to 6° in latitudinal extent and at all local times or longitudes.
그래서, 난 작동하지 않는 다음 명령을 사용하고 있습니다.
그것을 삭제할 수 있습니다. 중괄호 수의 균형을 맞추기를 원할 것이기 때문에 게시 된 코드를 사용하여 파일 전체에서 마지막 중괄호까지만 사용할 수 있습니다 (여러 줄로 실행한다고 가정). – OmnipotentEntity
아니요, 구문을 뒤섞고 있습니다. A, Bd는 A 행에서 B 행까지 삭제합니다 (여기서 A와 B는 행 번호 또는 정규 표현식이 될 수 있음). A, B, Cd는 구문 오류가되어야합니다. /A.*B.*C/는 A와 일치하는 정규 표현식이고, B 다음에 C가오고 그 사이에있는 어떤 것도 같은 줄에 있습니다. – tripleee