문장 사이에 네 줄 추가 [반복]

문장 사이에 네 줄 추가 [반복]

각 문장 사이에 4개의 빈 줄을 추가하는 쉬운 방법이 있습니까?

예를 들어, 이 단락은 다음과 같습니다.

This combination of vitamins and selected minerals is used to prevent or treat vitamin 
deficiency due to poor eating habits, problems that affect the body's ability to absorb nutrition from food, or increased need for vitamins and minerals due to stress 
or illness. Vitamins are needed for the body to function well.
This vitamin/mineral combination contains high levels of B vitamins (e.g., folic acid, 
niacin, B-1, B-2, B-6, and B-12) and vitamin C. It also contains other vitamins (A, D, and E) and minerals such as zinc. This medication does not contain iron and has only a 
small amount of calcium. Therefore, it should not be used to treat "iron-poor" blood 
(anemia) or to prevent osteoporosis.

어떻게 해야 하나요?

This combination of vitamins and selected minerals is used to prevent or treat vitamin 




deficiency due to poor eating habits, problems that affect the body's ability to absorb nutrition from food, or increased need for vitamins and minerals due to stress 




or illness. Vitamins are needed for the body to function well.




This vitamin/mineral combination contains high levels of B vitamins (e.g., folic acid, 




niacin, B-1, B-2, B-6, and B-12) and vitamin C. It also contains other vitamins (A, D, and E) and minerals such as zinc. This medication does not contain iron and has only a 




small amount of calcium. Therefore, it should not be used to treat "iron-poor" blood 




(anemia) or to prevent osteoporosis.

제 생각에는:

1- 각 줄 사이에 4개의 공백을 추가합니다.

2- 첫 번째 줄 뒤에 공백을 추가한 다음 4개의 공백마다 추가합니다.

답변1

sed할수있다

sed 'G;G;G;G' file

설명하다

답변2

sed 명령을 사용하여 수행했습니다.

sed "s/.*/&\n\n\n\n/g" filename

테스트를 거쳐 잘 작동함

관련 정보