The UNIX and Linux Forums  
Hello and Welcome from 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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Formatting Output dhanamurthy Shell Programming and Scripting 6 05-02-2008 12:43 PM
formatting output balaji_prk Shell Programming and Scripting 4 09-15-2007 10:23 AM
Formatting output illur81 Shell Programming and Scripting 3 10-13-2005 10:24 AM
diff 2 files; output diff's to 3rd file blt123 Shell Programming and Scripting 2 05-28-2002 12:29 PM
Formatting the output Cameron Shell Programming and Scripting 7 02-15-2002 10:30 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-29-2008
ragavhere ragavhere is offline
Registered User
  
 

Join Date: Apr 2008
Location: Chennai,India
Posts: 79
Lightbulb Formatting the output from diff

Hi,

i need to display the mismatches from two files.The output what is get is the entire rows which mismatch from file 1 are displayed first and the corresponding rows from file 2 are displayed below it.

Sample output:

From Test Run 1 - The row count of file2.txt is 23
From Test Run 1 - The row count of file3.txt is 20
From Test Run 1 - The row count of file4.txt is 2
From Test Run 2 - The row count of file2.txt is 22
From Test Run 2 - The row count of file3.txt is 21
From Test Run 2 - The row count of file4.txt is 1

Code used is:
diff -bi 21.txt 22.txt > 13.txt
sed -e '/^-/d' -e '/^[1-9]/d' -e 's/^[<>] //' 13.txt >> ab.out

how can the ouput be displayed this way?

From Test Run 1 - The row count of file4.txt is 2
From Test Run 2 - The row count of file4.txt is 1
From Test Run 1 - The row count of file2.txt is 23
From Test Run 2 - The row count of file2.txt is 22
From Test Run 1 - The row count of file3.txt is 20
From Test Run 2 - The row count of file3.txt is 21
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0