Sponsored Content
Top Forums Shell Programming and Scripting comparing file content differences Post 80402 by aigles on Monday 8th of August 2005 04:14:33 AM
Old 08-08-2005
Try somothing like this :

Code:
comm -3 /path/to/previous_list /path/to/actual_list | \
awk '
$0 ~ "^\t" {
   created[++created_idx]=$1;
   next;
}
{
   removed[++removed_idx]=$1 ;
   next;
}
END {

   if (created_idx > 0) {
      print "These files have been created"
      for (idx=1; idx <= created_idx; idx++)
         print "  " created[idx];
   } else {
      print "No files have been created"
   }

   if (removed_idx > 0) {
      print "These files have been removed"
      for (idx=1; idx <= removed_idx; idx++)
         print "  " removed[idx];
   } else {
      print "No files have been removed"
   }

} '


Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

comparing the content of two directories

Hello I want to compare the content of two directories recursively to check if the two directories have the same files. How can I do that? (2 Replies)
Discussion started by: xyzt
2 Replies

2. Shell Programming and Scripting

Comparing files columnwise and print the differences in third file

Hello Everybody!!!!!!!!! Request you to help me with the below mentioned issue: I have 2 files say, File 1: a|4|7 b|3|2 c|8|8 d|8|9 File 2: a|4|6 b|2|2 c|8|8 d|9|8 The third file(output file) should have: Data mismatch in row 1 column 3 Data mismatch in row 2 coumn 2 Data... (3 Replies)
Discussion started by: abhijeet1409
3 Replies

3. Shell Programming and Scripting

Comparing content of two variables

I have very abstract need of "comparing two variables" and take subsequent actions. please refer to image below https://lh3.googleusercontent.com/-frNk5iA3q1c/TjI3lE0sWOI/AAAAAAAAAIE/fxzB1w07gas/script_block.JPG I have a part of script which reads a file and generates variables based on... (4 Replies)
Discussion started by: animesharma
4 Replies

4. Shell Programming and Scripting

Perl: Comparing to two files and displaying the differences

Hi, I'm new to perl and i have to write a perl script that will compare to log/txt files and display the differences. Unfortunately I'm not allowed to use any complied binaries or applications like diff or comm. So far i've across a code like this: use strict; use warnings; my $list1;... (2 Replies)
Discussion started by: dont_be_hasty
2 Replies

5. Shell Programming and Scripting

Comparing two files and list the differences

Hi * I have two text files which has the file size, timestamp and the file name. I need to compare these two files and get the differences in the output format. Can anyone help me out with this. * cat file1.txt *474742 Apr 18* 2010 sample.log *135098 Apr 18* 2010 Testfile 134282 Apr 18* 2010... (7 Replies)
Discussion started by: Sendhil.Kumaran
7 Replies

6. Shell Programming and Scripting

comparing 2 files and creating third file with uncommon content

I want to compare 2 files and create third file with uncommon content. e.g. file1 ajay suhas tom nisha vijay mahish file2 ajay suhas tom nisha expected output file content vijay mahish Is it possible in single command ? Thanks, Ajay (6 Replies)
Discussion started by: ajaypatil_am
6 Replies

7. Shell Programming and Scripting

Help comparing 2 files and sending differences

I have 2 files that need to be compared. Email the differences if something is different and don't email if nothing is different. One or both of the files could be empty. One or both could have data in them. example files backup.doc.$(date +%y%m%d) file size is 0 backup.doc.$(TZ=CST+24... (4 Replies)
Discussion started by: jabbott3
4 Replies

8. Shell Programming and Scripting

Comparing 2 xml files and print the differences only in output

Hi....I'm having 2 xml files, one is having some special characters and another is a clean xml file does not have any special characters. Now I need one audit kind of file which will show me only from which line the special characters have been removed and the special characters. Can you please... (1 Reply)
Discussion started by: Krishanu Saha
1 Replies

9. Shell Programming and Scripting

Comparing file ownership/permission and content of files located on two different servers

Hi All, can some one suggest me a tool to compare file ownership/permission and contents of files located at two different unix servers? Thanks, Pranav (1 Reply)
Discussion started by: Pranav Bhasker
1 Replies

10. UNIX for Beginners Questions & Answers

Comparing time differences between 2 Solaris servers

Good day to all. I'm relatively new in using the Sun Solaris OS. I would like to request your expertise in helping to solve a problem that I have at work. Not sure if this has been asked before but I have tried searching through the internet to no avail. Basically I have 2 sun solaris... (8 Replies)
Discussion started by: Fossil_84
8 Replies
spectral-analysis(7)						  Numm Tutorials					      spectral-analysis(7)

NAME
spectral analysis - perform realtime spectral analysis SYNOPSIS
numm-run FILE DESCRIPTION
Frequency makes for a meaningful description of many audio signals. We can use numpy's fourier analysis to compute spectra from the micro- phone and display the results visually. We will break down the process into smaller parts: baby steps... First, create and save a skeletal file that moves a line across the screen: idx = 0 def video_out(a): global idx a[:,idx] = 255 idx = (idx + 1) % a.shape[1] def audio_in(a): pass Save this snippet and run it with numm-run. We will use the numpy.fft module for our analysis. First we define a function to get a particular frequency from the fourier transform: import numpy as np def get_freq(fourier, frequency): freqs = np.fft.fftfreq(len(fourier), 1/44100.0) nearest = (abs(freqs - frequency)).argmin() return abs(fourier[nearest]) Next, we hook up this function to audio input from the microphone. A frequency bin is chosen on a log scale for each row on the screen to display a spectogram. In total: import numpy as np idx = 0 recent_audio = np.zeros(4096, np.int16) recent_video = np.zeros((240,320,3), np.uint8) freq_bins = np.exp2(np.linspace(np.log2(27000),np.log2(27),240)) def get_freq(fourier, frequency): freqs = np.fft.fftfreq(len(fourier), 1/44100.0) nearest = (abs(freqs - frequency)).argmin() return abs(fourier[nearest]) def video_out(a): global idx fourier=np.fft.fft(recent_audio) values =np.array([get_freq(fourier,X) for X in freq_bins]) recent_video[:,idx,1] = (values/10000).clip(0,255) idx = (idx + 1) % a.shape[1] a[:] = np.roll(recent_video, -idx, axis=1) def audio_in(a): recent_audio[:] = np.roll(recent_audio, len(a)) recent_audio[:len(a)] = a.mean(axis=1) SEE ALSO
numm-run(1), numm.getting-started(7), numm.one-bit-instrument(7) numm February 2012 spectral-analysis(7)
All times are GMT -4. The time now is 10:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy