Sponsored Content
Top Forums Shell Programming and Scripting Finding first difference between two files Post 302768625 by Mojing on Saturday 9th of February 2013 03:24:13 AM
Old 02-09-2013
Finding first difference between two files

Hi!
I'd like to know if it is possible for a command to find the first difference between two large files, output that line from both file and stop, so no need to continue after that to save some computation time.

I don't think looping through it will be efficient enough but that's the only thing i can think of...

Better: Aside from outputting the different line, it would be better if it could output the preceding line too.

Thanks!!!!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

finding duplicate files by size and finding pattern matching and its count

Hi, I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern. Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies

2. Shell Programming and Scripting

Finding the time difference

Hi, I have two files A.txt and B.txt. And i have the following attributes in both the files. <date and time> <a unique id> For eg: <2007 May 30 20:29:36:034 GMT> <ID1> in A.txt <2007 May 30 20:42:36:038 GMT> <ID1> in B.txt Now, i need to find the time difference... (0 Replies)
Discussion started by: padma.raajesh
0 Replies

3. Shell Programming and Scripting

finding difference between 2 directory recursively

Hi, i'm trying to compare two directories in Unix. I need a recursive search ie my shell script should also compare common files in those two directory and so on... any clues.. ?? (2 Replies)
Discussion started by: yayati
2 Replies

4. Shell Programming and Scripting

Finding difference in two comma separated files in UINX

Dear All, I have requirement like this: I have 2 camma seperated files file1: 1,aaa,bbb,ccc, 2,bbb,ccc,ddd, 3,ccc,ddd,eee, file2: 1,aaa,bbb,ccc, 2,bbb,ddd,ddd, 3,ccc,ddd,eee, my requirement is I should get message in the out put like: There is a difference in 3 rd filed in... (2 Replies)
Discussion started by: mymoto
2 Replies

5. Shell Programming and Scripting

finding difference between two files

Hi, I have two files one with 12486 lines second one with 13116 As per the comparsion between two files the count have 630 difference I used diff command to find the difference between two files but it's not understandable could any one suggest any command to get 630 records in a new... (4 Replies)
Discussion started by: thelakbe
4 Replies

6. Shell Programming and Scripting

Need help in finding in date difference

Hi, My date is coming as STARTDATE=Sun Jul 15 00:34:23 2012 ENDDATE=Sun Jul 15 00:50:04 2012I want difference between these two dates,anyone's helps will be appriciated. Thanks Prasoon (3 Replies)
Discussion started by: prasson_ibm
3 Replies

7. UNIX for Dummies Questions & Answers

Finding difference in 1st field for rows of data

I have a file that has multiple lines, of grouped data, that typically all have the same values in the 1st field, however, I would like to search the 1st field for any differences and set a flag to use in an "if" statement to run some other routine. An example of the typical file is below,... (2 Replies)
Discussion started by: co21ss
2 Replies

8. Shell Programming and Scripting

Finding difference in 2 different timestamps

Legends, I have a requirement to run the script exactly after one hour of completion of dependent script. Eg: Script B should run after one hour on the completion of Script A. I got the time stamps using following variables. these scripts runs in autosys > DATE=`date +%H:%M` >... (4 Replies)
Discussion started by: sdosanjh
4 Replies

9. Shell Programming and Scripting

Finding difference in between two array's of strings

Hi, Can anybody help me in finding the difference between two array elements with the help of code pls. purge=("Purge Concurrent Request and/or Manager Data" "Purge Signon Audit data" "Purge Obsolete Workflow Runtime Data" "Purge Logs and Closed System Alerts") purge_1=("Purge Obsolete... (3 Replies)
Discussion started by: Y.balakrishna
3 Replies

10. Shell Programming and Scripting

Finding difference between two columns of unequal length

Hi, I have two files which look like this cat waitstate.txt 18.2 82.1 cat gostate.txt 5.6 5.8 6.1 6.3 6.6 6.9 7.2 7.5 (4 Replies)
Discussion started by: jamie_123
4 Replies
MATHO-PRIMES(1) 					       Mathomatic Utilities						   MATHO-PRIMES(1)

NAME
matho-primes - generate consecutive prime numbers SYNOPSIS
matho-primes [start [stop]] ["twin"] ["pal" [base]] matho-primes [-htu] [-c count] [-m number] [-p base] [start [stop]] DESCRIPTION
This command-line utility is optionally part of the mathomatic(1) package. It quickly computes any number of consecutive prime numbers using a windowing, memory efficient sieve of Eratosthenes algorithm, dumping them to standard output. They are displayed one prime per line in ascending order, unless the "twin" option is specified, which displays only twin primes, two primes per line. Generates up to 18 decimal digit primes, or whatever is the number of digits of precision for a floating point long double in the C com- piler used to compile this utility. Note that this utility might be compiled to use only double precision floating point, if long double precision is not fully supported by the C compiler or hardware, allowing at most 15 decimal digit primes in that case. Ways to verify that this utility is working are to pipe the output into the Unix "factor" utility, or compare the output with the BSD Games "primes" utility. All numbers displayed by this utility are decimal (base 10) prime numbers. A prime number is an integer that cannot be factored. A range may be specified on the command line, otherwise the starting number and the number of primes to output is prompted for. The range is start to stop inclusive, and stop must be greater than or equal to start. If the -c option is specified, the number of lines of primes displayed is limited to the decimal count that follows this option. If the -t or "twin" option is specified on the command line, only twin primes will be displayed. Twin primes are two primes that differ in value by 2. Each twin pair is displayed together on the same line separated by a space character. If the -p or "pal" option is specified on the command line, only palindromic primes are displayed. Palindromes are symmetrical, they read exactly the same forward and backward. The palindromic number base may be specified, the default is base 10. The base can be any integer greater than 1. Primes are always displayed in decimal (base 10). The version number and short help on the allowed command-line parameters and usage information are displayed when given the -h option. With the -u option, all output (standard output and standard error output) is set to be unbuffered, making all output happen immediately, instead of when the output buffer is full or when the program terminates or waits for input. The -m option changes the memory size of the prime number sieve window. It is followed by a decimal, floating point number which is a mul- tiplier of the default window size. It is possible that changing the memory size may speed up the total run time; otherwise there is no reason to use this option. AUTHOR
George Gesslein II (gesslein@mathomatic.org) at "http://www.mathomatic.org". REPORTING BUGS
If you find a bug, please report it to the author or at "https://launchpad.net/mathomatic". SEE ALSO
mathomatic(1), primorial(1), matho-mult(1), matho-sum(1) Mathomatic MATHO-PRIMES(1)
All times are GMT -4. The time now is 12:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy