Skip to main content
8 of 9
markup
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k

How to merge lines in groups of three

I have a file containing the below pattern, up to 2000 lines. For every group of three lines, the pattern repeats with different numerical values, but text values at the beginning are common up to the end of the file.

Here I need to merge set of three lines, like Need output looks like..

ABC 1223334 Days 344678544324677 Base 45666 ABC 1234565 Days 234567899765443 Base 456643 . . . 

Please guide me in this regard. Input like below.

ABC 1223334 Days 344678544324677 Base 45666 ABC 1234565 Days 234567899765443 Base 456643 . . . .