Skip to content
Advertisement

How to merge two rows in a same row from a text file in linux shell script

From Nagios I downloaded its html file by using wget command and then I converted that htmlfile to Textfile by using following code:

JavaScript

then I cut the first 10 lines becoz I dont want that text and I got below textfile output

JavaScript

I have to merge two rows into single row not for all lines only for particular output from b.txt file. Note: the text file contains N number of lines

Here the b.txt File Output:

JavaScript

Expected output:

JavaScript

Thanks in advance

Advertisement

Answer

You can use awk to merge lines together:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement