Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support to find difference between two files Post 302357614 by otheus on Wednesday 30th of September 2009 08:57:21 AM
Old 09-30-2009
Yeah, sorting them should help here. Also, make sure your oldfile and newfile dont have spaces or funny characters in the filename.
Code:
sort "$newfile" >"$newfile".sorted
sort "$newfile" >"$oldfile".sorted
comm -23 "$newfile".sorted "$oldfile".sorted

I think adding the -u (uniqify) parameter to the sort command makes sense here.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find difference in two files

Hola, Tengo un texto texto1.txt con el siguiente contenido: Malaga Cadiz Sevilla Hola Y otro .txt texto2.txt con: Malaga Cadiz Sevilla Cordoba Huelva quiero obtener en otro .txt la diferencia entre estos dos archivos: (14 Replies)
Discussion started by: danietepa
14 Replies

2. Solaris

Need help to find difference between two files

I need to find the difference between two files in UNIX. I tried diff, but couldn't get it right. There are two files: file1: apple mango strawberry banana grape file2: grape apple banana I need an output file like below: ... (11 Replies)
Discussion started by: kisaad
11 Replies

3. UNIX for Dummies Questions & Answers

Find difference between two files

I have two files as below File1: a b c d File2: a b When i find the difference the output would be c&d.. How can i get my requirement...pls help... Many thanks in advance (10 Replies)
Discussion started by: jagadish_gaddam
10 Replies

4. Shell Programming and Scripting

Find file size difference in two files using awk

Hi, Could anyone help me to solve this problem? I have two files "f1" and "f2" having 2 fields in each, a) file size and b) file name. The data are almost same in both the files except for few and new additional lines. Now, I have to find out and print the output as, the difference in the... (3 Replies)
Discussion started by: royalibrahim
3 Replies

5. UNIX for Advanced & Expert Users

Find difference between 2 files

I have 2 files as follows. file1.txt <cell>123</cell> <cell>345</cell> file2.txt <cell>123</cell> <cell>456</cell> out out should be output.txt <cell>456></cell> How do we achieve this> The difference betwenn the two files should be wirtten to the output file.. ... (2 Replies)
Discussion started by: kanthrajgowda
2 Replies

6. Shell Programming and Scripting

To find difference between two files on a whole

Hi, The requirement is to compare two files that has single column of records each. Comparison is to happen on a whole and not line by line. File1.txt 314589929 315611087 304924413 315989094 301171509 302984393 315609549 314593632 File2.txt 315611087 304924413 315989094 (2 Replies)
Discussion started by: anandek
2 Replies

7. Shell Programming and Scripting

script to find whether the difference between two files in only additions but not modifications

i basically have 2 files and sdiff of the files is given below sdiff file1 file 2 control_file < path INDEX < size 613 < mode 0444 ... (1 Reply)
Discussion started by: under_cons
1 Replies

8. Shell Programming and Scripting

Script to find difference between 2 files by column

Hi , i am newbie to shell scripting and am trying to do the below job, A shell script to be run with a command like sh Compare.ksh file1.txt file2.txt 1 2 > file3.txt 1 2-are the key columns Consider the delimiter would be Tab or comma File 1: SK TEST NAME MATHS PHYSICS 21 1... (1 Reply)
Discussion started by: shakthi666
1 Replies

9. Homework & Coursework Questions

Script to find difference between 2 files by column

Hi , i am newbie to shell scripting and am trying to do the below job, A shell script to be run with a command like sh Compare.ksh file1.txt file2.txt 1 2 > file3.txt 1 2-are the key columns Consider the delimiter would be Tab or comma File 1: SK TEST NAME MATHS PHYSICS 21 1 AAA... (1 Reply)
Discussion started by: shakthi666
1 Replies

10. Shell Programming and Scripting

Find difference in content between two particular lines in two files

I have two files named Before.txt and After.txt: Now i want to find the difference in content between <Marker 1> and <Marker 2> in the two files. ---------- Post updated at 05:00 PM ---------- Previous update was at 04:50 PM ---------- Any help will be highly appreciated..:) (3 Replies)
Discussion started by: proactiveaditya
3 Replies
NNSTATS(1m)															       NNSTATS(1m)

NAME
nnstats - display nnmaster collection and expire statistics SYNOPSIS
nnstats [ -lt ] [ -d month day ] [ -m month ] [ logfile ]... DESCRIPTION
nnstats will extract the collection (C) and expiration (X) entries from the log file and calculate total and average number of articles, groups and elapsed time per day, per month, or for the duration of the whole log file. Normally only a summary for the specified period is printed. If -l is specified, the statistics for each day in the period is also printed, and if -t is specified the summary is not printed. Normally the statistics is collected for all days in the log files (or the current log file if one is not specified). If "-m month" is specified, the statistics for that month is calculated. The month is specified in normal date notation, i.e. a capital- ized three letter abbreviation like Jan, Feb, ... If "-d month day" is specified, the statistics for that date only is calculated and printed. FILES
../Log The log file SEE ALSO
nn(1), nnusage(1M), nnadmin(1M), nnmaster(8) NOTES
If nnmaster is run with options -LCX, nnstats will not work, because the necessary entries are not written to the log file. AUTHORS
Mark Moraes <moraes@csri.toronto.edu> Kim F. Storm <storm@texas.dk> 4th Berkeley Distribution Release 6.6 NNSTATS(1m)
All times are GMT -4. The time now is 06:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy