The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
concatenate files sorted by date docaia Shell Programming and Scripting 2 08-15-2008 11:23 PM
executing code on files in the sorted order -help! epi8 Shell Programming and Scripting 1 05-20-2008 12:30 AM
Compare two files amir07 Shell Programming and Scripting 6 03-26-2008 08:23 AM
Compare files kharen11 UNIX for Advanced & Expert Users 25 03-14-2007 02:35 AM
help! need to compare files danielsf Shell Programming and Scripting 6 07-09-2003 02:09 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 01-25-2008
Registered User
 

Join Date: Jan 2008
Posts: 8
Hi,

Some remarks first:
1. the 'grep -x -v -f' command *perfectly* works
(it simply depends on the way you're using it...).
2. your files (EAIDVBR1.txt EAIDQBR1.txt) are DOS-formatted
and contains many blank characters... (this explains why
most of the Unix diff commands seem to fail).

As a consequence, following the steps below should provide the
expected results:

# 1. Convert and cleanup the input files
for FILE in EAIDVBR1.txt EAIDQBR1.txt; \
do \
echo "... converting ${FILE}"; \
dos2ux ${FILE} | sed -e 's@ @@g' > ${FILE}.new; \
done

# 2. Get the required differences (strings in EAIDQBR1.txt
# which do not appear in EAIDVBR1.txt)
grep -x -v -f EAIDVBR1.txt.new EAIDQBR1.txt.new
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0