The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: AWK scripting
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-26-2008
Muki101 Muki101 is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 9
AWK scripting

I have a text file in which the text has been divided into paragraphs (two line breaks or tab marks a new paragraph) and I want to make a script which output would delete line breaks within the paragraph and the different paragraphs would be separated by two line breaks.

So, if my input file is:

Code:
     The first line.
Second line.

First line of the second paragraph.
Second line of the second paragraph.
I want the output to be something like:
Code:
The first line. Second line.

First line of the second paragraph. Second line of the second paragraph.
I have tried now for some hours to come up with something reasonable, but I seem to be heading the wrong way. I would be really pleased if someone gave their idea of how to solve the problem.

Thanks!