Awk and sort (of text files)

Stephen Davies sdavies at sdc.com.au
Mon Jun 29 01:02:01 UTC 2015


I would just concatenate lines until the blank is reached then write out the 
concatenated line.
The result can then be sorted.

If you want to revert the result to paragraphs, just reverse the process 
outputting lines of up to N characters ending in a space.

HTH,
Stephen

On 29/06/15 10:13, jd1008 wrote:
>
>
> On 06/28/2015 06:38 PM, jd1008 wrote:
>> Hi,
>> I have text files made of paragraphs of text, separated by
>> blank lines.
>>
>> Each "paragraph" is information about a different item.
>>
>> In need to sort these paragraphs based on the first line
>> of each paragraph.
>>
>> Need some hints how to accomplish this.
>>
>> Thanx.
> Forgot to say that each paragraph is made of multiple lines,
> but a paragraph's lines do not contain a blank line.


-- 
=============================================================================
Stephen Davies Consulting P/L                             Phone: 08-8177 1595
Adelaide, South Australia.                                Mobile:040 304 0583
Records & Collections Management.


More information about the users mailing list