Can you limit the compare on "comm" command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Can you limit the compare on "comm" command
# 1  
Old 03-23-2007
Can you limit the compare on "comm" command- ANSWER FOUND PLEASE IGNORE.

I need to find deleted records from a file. I compare yesterdays file.old to todays file.new. I need to find the records that were in yesterdays file that are not in todays. My file is fixed field. If I run a "comm -23" obviously what i find is not necesarilly a delete, it could be a change.

The first 10 characters of each line are always static. So my option is to cut the first 10 chars from each file into seperate fiels. COmpare these seperate files. That way I find true delete records. Problem is I need the rest of the record that I cut off. I know I can somehow creatively use awk and grep to rebuild these, but I was wondering:

Is there an option to pass to the com command to tell it to only compare the frist 10 characters of each line inmy 2 files? Thus making all the extra work not necessary.

Thank you.

I figured out a way to do this. thank you all for viewing the message.

Last edited by eja; 03-28-2007 at 11:21 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Beginners Questions & Answers

Extract delta records using with "comm" and "sort" commands combination

Hi All, I have 2 pipe delimited files viz., file_old and file_new. I'm trying to compare these 2 files, and extract all the different rows between them into a new_file. comm -3 < sort file_old < sort file_new > new_file I am getting the below error: -ksh: sort: cannot open But if I do... (7 Replies)
Discussion started by: njny
7 Replies

3. Red Hat

Postfix keeps returning "Command time limit exceeded" message

We are having issues with our Postfix. The POP and IMAP services randomly stops working an sent e-mails return a "Command time limit exceeded". We've found out that running these command fix the problem: service cyrus-imapd stop rm /var/lib/imap/tls_sessions.db* rm... (2 Replies)
Discussion started by: GustavoAlvarado
2 Replies

4. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

5. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

8. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

9. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

10. Shell Programming and Scripting

Problems in "comm"

With respect to my other query I was trying to compare the data in files with "comm" command. File -1: (InCU_notDB) EP120307602281841 EP120607602631482 EP120607602631483 EP120607602631484 EP120607602631485 EP120607602631486 EP120607602631487 EP092905800544601 EP071708601490636... (4 Replies)
Discussion started by: swame_sp
4 Replies
Login or Register to Ask a Question
BTARCMP(1)						      General Commands Manual							BTARCMP(1)

NAME
btarcmp - a diff for Barry tar backup files SYNOPSIS
btarcmp [-b][-d db][-D db][-h][-I charset][-P][-S][-v] tar0 tar1 DESCRIPTION
btarcmp takes two Barry backup tar files on the command line, and displays the differences it finds between them. If records can be parsed, individual field differences are also displayed. Added and removed records are noted. Differences in database availability are noted as well. If unable to parse the records, hex dumps are used. OPTIONS
-b Use brief filename markers. Useful when tar filenames are extremely long. -d db Name of database to compare. Can be used multiple times to compare multiple databases. If not specified, all databases are com- pared. -D db Name of database to skip. Can be used multiple times. Overrides all other database selection options. -h Show summary of options. -I charset Specifies the iconv charset to use for converting international strings. The Blackberry uses the WINDOWS-1252 charset, which is incompatible with the more common code pages used in Linux. The most useful charset to use with this option is UTF-8, and is highly recommended. Any other charset available via 'iconv --list' can be used here too, but may not be successful for some character con- versions. -S Displays list of known database records, which can be parsed. -v Verbose output, which includes record data of added and deleted records in the output. If used twice, hex data is printed as well. AUTHOR
btarcmp is part of the Barry project. SEE ALSO
http://www.netdirect.ca/barry January 20, 2010 BTARCMP(1)