Sponsored Content
Top Forums Shell Programming and Scripting Diff two files with threshold value Post 302555960 by Nishi2011 on Friday 16th of September 2011 07:58:50 AM
Old 09-16-2011
yes
only if it appears in both files
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

diff 2 files; output diff's to 3rd file

Hello, I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3. For example: file 1 123 1234 123456 file 2 123 2345 23456 file 3 should have 2345 23456 I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies

2. Shell Programming and Scripting

Find duplicates from multuple files with 2 diff types of files

I need to compare 2 diff type of files and find out the duplicate after comparing each types of files: Type 1 file name is like: file1.abc (the extension abc could any 3 characters but I can narrow it down or hardcode for 10/15 combinations). The other file is file1.bcd01abc (the extension... (2 Replies)
Discussion started by: ricky007
2 Replies

3. Shell Programming and Scripting

Compare all files in a directory to a threshold value

Hi guys, I have the following, and would like to enhance it be be able to run it in the hard coded directory and compare each file in the directory with the expectedSizeHow would I go about doing this? Thanks, Bloke #!/bin/sh ] || { echo "Usage: watchSizes 400"; exit 0 ; } #Hammer: How... (1 Reply)
Discussion started by: Bloke
1 Replies

4. Shell Programming and Scripting

Diff b/w 2 files

Hi Masters, I have two files named file1 and file2. Both the files contains the same contents with some difference in comments,space.But no content change. I tried to find the diff between the two files to make sure that contents are same. For that i tried diff -ibw file1 file2 But... (1 Reply)
Discussion started by: ecearund
1 Replies

5. Shell Programming and Scripting

diff of files

Hi, I have 2 files.I want to check if file1 is contained in file2. A.txt: ----- AAA BBB B.txt: ------ CCC AAA BBB DDD I want to check if A.txt is contained in B.txt. Can it be done using SED ? (12 Replies)
Discussion started by: giri_luck
12 Replies

6. Shell Programming and Scripting

diff bw two files

Hi All, I have two files which look as below File1 serial="1" name="abc" type="employee" field="IT" serial="2" name="cde" type="intern" field="Marketing" serial="3" name="pqr" type="contractor" field="IT" serial="4" name="xyz" type="employee" field="Sales" File2 serial="1"... (3 Replies)
Discussion started by: grajp002
3 Replies

7. Shell Programming and Scripting

Using Diff to Compare 2 files

Hi I've been trying various methods that I have found online with regards to comparing 2 files using the diff command. Nothing seems to work. The problem is that I'm not too familiar with the proper syntax. Can you please assist me. Here is my script: #!/bin/bash awk -F',' -v file1="$1"... (9 Replies)
Discussion started by: ladyAnne
9 Replies

8. Shell Programming and Scripting

.procmailrc and uudeview (put attachments from diff senders to diff folders)

Moderator, please, delete this topic (1 Reply)
Discussion started by: optik77
1 Replies

9. Shell Programming and Scripting

Script for deleting files and directories when the file system reaches the threshold

Hi Can someone assist in writing a script. I have a filesystem named /sybase in my aix lpar. When this filesystem becomes 94% full all the files and directories under /sybase/logs should be deleted immediately. :confused: (7 Replies)
Discussion started by: newtoaixos
7 Replies

10. Shell Programming and Scripting

Diff 3 files, but diff only their 2nd column

Guys i have 3 files, but i want to compare and diff only the 2nd column path=`/home/whois/doms` for i in `cat domain.tx` do whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies
pack(1) 						      General Commands Manual							   pack(1)

Name
       pack, pcat, unpack - compress and expand files

Syntax
       pack [ - ] [ -f ] name...

       pcat name...

       unpack name...

Description
       The  command stores the specified files in a compressed form.  Wherever possible (and useful), each input file name is replaced by a packed
       file name.z with the same access modes, access and modified dates, and owner as those of name.  The  -f	option	forces	packing  of  name.
       Using  this option you can cause an entire directory to be packed even if some of the files cannot benefit from it.  If is successful, name
       is removed.  Packed files can be restored to their original form using or

       The command uses Huffman (minimum redundancy) codes on a byte-by-byte basis.  If a hyphen (-) is used as an argument, an internal  flag	is
       set that causes the number of times each byte is used, its relative frequency, and the code for the byte to be printed on the standard out-
       put.  Additional occurrences of a hyphen (-) in place of name causes the internal flag to be set and reset.

       The amount of compression obtained depends on the size of the input file and the character frequency distribution.  Because a decoding tree
       forms  the first part of each .z file, it is usually not worthwhile to pack files smaller than three blocks, unless the character frequency
       distribution is skewed, which may occur with printer plots or pictures.

       Typically, text files are reduced to 60-75% of their original size.  Load modules, which use a larger character set and have a more uniform
       distribution of characters, show little compression.  The packed versions are about 90% of the original size.

       The command returns a value that is the number of files that it failed to compress.

       No packing occurs if one of the following is true:

       o    The file appears packed.

       o    The file name exceeds 12 characters.

       o    The file has links.

       o    The file is a directory.

       o    The file cannot be opened.

       o    No disk storage blocks can be saved by packing.

       o    A file called already exists.

       o    The .z file cannot be created.

       o    An I/O error occurred during processing.

       The  last  segment of the file name must not exceed 12 characters to allow space for the appended .z extension.	Directories cannot be com-
       pressed.

       The command does for packed files what does for ordinary files, except that can not be used as a filter.  The specified files are  unpacked
       and written to the standard output.  Thus, to view a packed file named name.z use:
       pcat name.z
       or just:
       pcat name
       To make an unpacked copy, say nnn, of a packed file named (without destroying name.z) use the command:
       pcat name >nnn
       The command returns the number of files it was unable to unpack.  Failure may occur if:

	      the file name (exclusive of the .z) has more than 12 characters;
	      the file cannot be opened;
	      the file does not appear to be the output of pack.

       The  command expands files created by For each file name specified in the command, a search is made for a file called name.z (or just name,
       if name ends in .z).  If this file appears to be a packed file, it is replaced by its expanded version.	The new file  has  the	.z  suffix
       stripped from its name, and has the same access modes, access and modification dates, and owner as those of the packed file.

       The  command returns a value that is the number of files it was unable to unpack.  Failure occurs for the same reasons that it occurs in as
       well as for the following:

	      a file with the unpacked name already exists;
	      if the unpacked file cannot be created.

       This command is present only for compatibility.	In general, the command runs faster and gives better compression.

See Also
       cat(1), compress(1)

																	   pack(1)
All times are GMT -4. The time now is 05:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy