Add four lines between sentences
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Is there an easy way to add four empty lines between each sentence.
For example, this paragraph:
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.
How I can make it:
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.
I would like:
1- to add four blank spaces between each line.
2- to add one blank space after the first line then every four spaces
text-processing awk sed text-formatting
New contributor
Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
Is there an easy way to add four empty lines between each sentence.
For example, this paragraph:
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.
How I can make it:
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.
I would like:
1- to add four blank spaces between each line.
2- to add one blank space after the first line then every four spaces
text-processing awk sed text-formatting
New contributor
Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Add four lines between every line:sed 's/$/nnnn/' file
– Cyrus
1 hour ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Is there an easy way to add four empty lines between each sentence.
For example, this paragraph:
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.
How I can make it:
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.
I would like:
1- to add four blank spaces between each line.
2- to add one blank space after the first line then every four spaces
text-processing awk sed text-formatting
New contributor
Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Is there an easy way to add four empty lines between each sentence.
For example, this paragraph:
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.
How I can make it:
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.
I would like:
1- to add four blank spaces between each line.
2- to add one blank space after the first line then every four spaces
text-processing awk sed text-formatting
text-processing awk sed text-formatting
New contributor
Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 30 mins ago


Jeff Schaller
33.9k851113
33.9k851113
New contributor
Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 1 hour ago
Gabi
284
284
New contributor
Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Gabi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Add four lines between every line:sed 's/$/nnnn/' file
– Cyrus
1 hour ago
add a comment |Â
Add four lines between every line:sed 's/$/nnnn/' file
– Cyrus
1 hour ago
Add four lines between every line:
sed 's/$/nnnn/' file
– Cyrus
1 hour ago
Add four lines between every line:
sed 's/$/nnnn/' file
– Cyrus
1 hour ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
sed
can do it
sed 'G;G;G;G' file
Explanation 💡:
According to sed man the flag G
is to append a newline to the contents of the pattern space, and then append the contents of the hold space to that of the pattern space.
In the command above every G
would add one new line.
In order to add one blank space after the first line then one empty space every four lines,
In GNU sed:
sed '1~4G' file
1~4
means match every four lines starting with line first,so the above command will begin creating a blank line after the first line and then every four lines.
Hi @Goro thank you for the answer and explanation. I have second question, how can I add one empty line every four lines?
– Gabi
58 mins ago
@Gabi you are welcome! please update the text of the question, include any additional questions you may have to avoid confusing people. then I will update my answer accordingly!
– Goro
54 mins ago
1
I added the new question@Goro thanks
– Gabi
48 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
sed
can do it
sed 'G;G;G;G' file
Explanation 💡:
According to sed man the flag G
is to append a newline to the contents of the pattern space, and then append the contents of the hold space to that of the pattern space.
In the command above every G
would add one new line.
In order to add one blank space after the first line then one empty space every four lines,
In GNU sed:
sed '1~4G' file
1~4
means match every four lines starting with line first,so the above command will begin creating a blank line after the first line and then every four lines.
Hi @Goro thank you for the answer and explanation. I have second question, how can I add one empty line every four lines?
– Gabi
58 mins ago
@Gabi you are welcome! please update the text of the question, include any additional questions you may have to avoid confusing people. then I will update my answer accordingly!
– Goro
54 mins ago
1
I added the new question@Goro thanks
– Gabi
48 mins ago
add a comment |Â
up vote
3
down vote
sed
can do it
sed 'G;G;G;G' file
Explanation 💡:
According to sed man the flag G
is to append a newline to the contents of the pattern space, and then append the contents of the hold space to that of the pattern space.
In the command above every G
would add one new line.
In order to add one blank space after the first line then one empty space every four lines,
In GNU sed:
sed '1~4G' file
1~4
means match every four lines starting with line first,so the above command will begin creating a blank line after the first line and then every four lines.
Hi @Goro thank you for the answer and explanation. I have second question, how can I add one empty line every four lines?
– Gabi
58 mins ago
@Gabi you are welcome! please update the text of the question, include any additional questions you may have to avoid confusing people. then I will update my answer accordingly!
– Goro
54 mins ago
1
I added the new question@Goro thanks
– Gabi
48 mins ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
sed
can do it
sed 'G;G;G;G' file
Explanation 💡:
According to sed man the flag G
is to append a newline to the contents of the pattern space, and then append the contents of the hold space to that of the pattern space.
In the command above every G
would add one new line.
In order to add one blank space after the first line then one empty space every four lines,
In GNU sed:
sed '1~4G' file
1~4
means match every four lines starting with line first,so the above command will begin creating a blank line after the first line and then every four lines.
sed
can do it
sed 'G;G;G;G' file
Explanation 💡:
According to sed man the flag G
is to append a newline to the contents of the pattern space, and then append the contents of the hold space to that of the pattern space.
In the command above every G
would add one new line.
In order to add one blank space after the first line then one empty space every four lines,
In GNU sed:
sed '1~4G' file
1~4
means match every four lines starting with line first,so the above command will begin creating a blank line after the first line and then every four lines.
edited 42 mins ago
answered 1 hour ago
Goro
9,07664486
9,07664486
Hi @Goro thank you for the answer and explanation. I have second question, how can I add one empty line every four lines?
– Gabi
58 mins ago
@Gabi you are welcome! please update the text of the question, include any additional questions you may have to avoid confusing people. then I will update my answer accordingly!
– Goro
54 mins ago
1
I added the new question@Goro thanks
– Gabi
48 mins ago
add a comment |Â
Hi @Goro thank you for the answer and explanation. I have second question, how can I add one empty line every four lines?
– Gabi
58 mins ago
@Gabi you are welcome! please update the text of the question, include any additional questions you may have to avoid confusing people. then I will update my answer accordingly!
– Goro
54 mins ago
1
I added the new question@Goro thanks
– Gabi
48 mins ago
Hi @Goro thank you for the answer and explanation. I have second question, how can I add one empty line every four lines?
– Gabi
58 mins ago
Hi @Goro thank you for the answer and explanation. I have second question, how can I add one empty line every four lines?
– Gabi
58 mins ago
@Gabi you are welcome! please update the text of the question, include any additional questions you may have to avoid confusing people. then I will update my answer accordingly!
– Goro
54 mins ago
@Gabi you are welcome! please update the text of the question, include any additional questions you may have to avoid confusing people. then I will update my answer accordingly!
– Goro
54 mins ago
1
1
I added the new question@Goro thanks
– Gabi
48 mins ago
I added the new question@Goro thanks
– Gabi
48 mins ago
add a comment |Â
Gabi is a new contributor. Be nice, and check out our Code of Conduct.
Gabi is a new contributor. Be nice, and check out our Code of Conduct.
Gabi is a new contributor. Be nice, and check out our Code of Conduct.
Gabi is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475398%2fadd-four-lines-between-sentences%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Add four lines between every line:
sed 's/$/nnnn/' file
– Cyrus
1 hour ago