🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3633

Diff for text files whose paragraphs are out of order

#3633
From: Steve Silberberg
Date: Sun, 23 Aug 1998 00:00
47 lines
1698 bytes
I am trying to write a program that will re-order a file so that the 
paragraphs are lined up.  Then I can just run diff on the result.

So for instance if I had 2 text files, each with 3 paragraphs:

Text File 1
-----------------
abc 123

I am in cyberspace

this is a text file


Text File 2
----------------
this is a text file

abc 134

I am in cyberspace


Output
-------------
abc 134

I am in cyberspace

this is a text file



I'd like the program to reorder Text File 2 so I can then run the result 
through diff.  I realize that if the two files are completely different, the 
output will look pretty wacky, but I'm not too worried abouyt that.

Any ideas on how to write such a program?  Does such a utility already exist?
Many many thanks in advance.
Steve

----------------
Steve Silberberg
mailto:stevebo@onramp.net
Visit the Air Sickness Bag Museum at:
http://rampages.onramp.net/~stevebo/airsick.html
FACT:  Buff Babes Dig Cut Dudes!
Technical Details
Message-ID: <6rpg3f$qr0$1@news.onramp.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,7e538404d40fb750,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: f8c9b,7e538404d40fb750,start
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: fc89c,7e538404d40fb750,start
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 1012a6,7e538404d40fb750,start
X-Google-Attributes: gid1012a6,public
From: stevebo@onramp.net (Steve Silberberg)
Subject: Diff for text files whose paragraphs are out of order
Date: 1998/08/23
Message-ID: <6rpg3f$qr0$1@news.onramp.net>
X-Deja-AN: 383924966
Organization: Callipygian Productions
Newsgroups: comp.unix.programmer,comp.unix.questions,comp.unix.shell,gnu.gcc.help