How to print a text file separated by 3 paragraphs?

Taran Basi

New Member
Credits
0
I have a textfile that contains a story from a book, and I want the Linux terminal to print out this story but with paragraphs that are 3 lines long.

What would be the best command to use?

Thanks
 


wizardfromoz

Super Moderator
Staff member
Gold Supporter
Credits
7,500
G'day @Taran Basi and welcome to linux.org :)

I am moving this Thread to Command Line where it will attract more specialised knowledge and responses.

Let us know what version of Ubuntu you are using.

Good luck

Chris Turner
wizardfromoz
 

kenJackson

Member
Credits
0
... I want the Linux terminal to print out this story but with paragraphs that are 3 lines long.
Your description isn't clear. But if the text is longer than the screen width and you want it to wrap, you could use the fold utility, which is part of coreutils and is surely included in every distro.

Code:
fold -sw74 file.txt
Use -s to break at spaces. Use -w74 to set the width to 74 columns.
 


Staff online


Top