Sponsored Content
Top Forums Shell Programming and Scripting Compare two files and mismatch report Post 302424245 by dgmm on Monday 24th of May 2010 04:07:21 PM
Old 05-24-2010
Hi
I want to compare for each line and each field of that line.
Read the first line
split the line to different fields.
Compare
f1.first field with f2.first field
f1.second field with f2.second field
and so on
if any of the field mismatch then
write the f1 record to f3.

Complete the loop till end of file f1.

Can some once interpret this in Perl or awk.
This is what I want.
By the way the grep command didn't work in my shell.

Thanks
Dgmm
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comparing two files and find mismatch

hi i have two files and i want to compare both the files and find out mismatch in 3rd file file1 00354|1|0|1|1|0|0|0|1|2 52424|1|0|1|1|0|0|0|1|2 43236|1|0|1|1|0|0|0|1|2 41404|1|0|1|1|0|0|0|1|2 79968|1|0|1|1|0|0|0|1|2 file2 00354|1|0|1|1|0|0|0|1|2 52424|1|0|1|1|0|0|0|0|2... (9 Replies)
Discussion started by: dodasajan
9 Replies

2. Shell Programming and Scripting

compare three files and insert a blank line at each mismatch

i need to compare three files in unix a.txt b.txt c.txt 1 2 1 2 5 3 4 6 5 5 6 6 i need to insert a blank line in the file if i don't find a match and put the items at the same column if found a match The items in the files... (4 Replies)
Discussion started by: mad_man12
4 Replies

3. Shell Programming and Scripting

Edited: compare two files and print mismatch

Using unix shell script, how to compare two files and print lines with mismatch? Below are the requirements: 1. The number of lines on the two files is not the same. 2. The difference/mismatch can be found on the second or third column. 3. The comparison is not between line 1 of file 1 and line... (16 Replies)
Discussion started by: kingpeejay
16 Replies

4. UNIX for Dummies Questions & Answers

mawk script to compare 2 files and report where they match

I have two files and would like a report of where they match. Example of file1: 1 1 1 2 2 2 13 14 15 4 4 4 15 16 17 100 102 1004 56 57 890 Example of file2: 2 2 2 16 10 11 45 22 35 13 14 15 1001 1002 3456 100 102 1004 (1 Reply)
Discussion started by: kenneth.mcbride
1 Replies

5. Shell Programming and Scripting

Compare selected columns of two files and print whole line with mismatch

hi! i researched about comparing two columns here and got an answer. but after examining my two files, i found out that the first columns of the two files are not unique with each other. all i want to compare is the 2nd and 3rd column. FILE 1: ABS 456 315 EBS 923 163 JYQ3 654 237 FILE 2:... (1 Reply)
Discussion started by: engr.jay
1 Replies

6. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

7. UNIX for Dummies Questions & Answers

Files count mismatch when used with Tar with find

Hi I have used the below steps and found some discrepancies step 1 : find ./ -type f -mtime +7 -name "*.00*" | wc -l = 13519 ( total files ) ( the size of this files is appx : 10GB ) step 2: find ./ -type f -mtime +7 -name "*.00*" | xargs tar zcvf Archieve_7.tar.gz step... (7 Replies)
Discussion started by: rakeshkumar
7 Replies

8. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

9. Shell Programming and Scripting

Need help in comparing two files in UNIX with a mismatch

Hi Everyone, I am comparing results of two environments using unix files. I am writing two different csv file using spool and merging both the files using paste command paste -d, file1.csv file2.csv > prod_uat_result.csv and then finding the difference and attaching the same in a mail... (8 Replies)
Discussion started by: karthik adiga
8 Replies

10. AIX

Compare two files and show the mismatch columns

I need to compare two files and find the mismatch columns in it for csv and fixed width file. Eg: file1 c1,c2,c3,c4<----columnname 1,a,4,d 2,b,5,e 3,c,6,f file2 c1,c2,c3,c4<----columnname 3,x,7,f 2,y,8,e 1,z,9,d output c2,c3<---- mismatch columname a,4 x,7 b,5 or y,8 Ok with... (3 Replies)
Discussion started by: sabzR
3 Replies
DECNET.CONF(5)							File Formats Manual						    DECNET.CONF(5)

NAME
/etc/decnet.proxy - DECnet proxy file DESCRIPTION
/etc/decnet.proxy is an ASCII file which contains mappings of remote DECnet users to local users. It is used by fal(8) when no username and password have been explicitly given to determine whether a user is allowed to access files and also whose files they will get access to. There is one entry per line, and each line has the following format: node::remoteuser localuser The field descriptions are: node The name or number of the remote node. If this is a name it must appear in decnet.conf(5) otherwise a DECnet node address should be used. This field is a regular expression: If you want to match a single nodename then you must use the anchors ^ and $ either side of the name. remoteuser a regular expression that may match one or more remote user names. If you want to match a single user then you must use the anchors ^ and $ either side of the name. localuser The name of a user on the local machine or a single asterisk (*) in which case the remote username will be substituted. Comments start with a hash mark and continue to the end of that line. They may be on a dedicated line or following an entry. EXAMPLE
#/etc/decnet.proxy # proxy configuration for fal. # ^tramp$::^test$ christine # Explicitly convert 'test' on tramp to 'christine' ^zaphod$::.* none # Disable proxies from zaphod (assuming you don't # have a user called 'none') .*::.* decnet # Like a default DECnet account .*::.* * # Equivalent to VMS *::* * proxy (make this last # if you use it) SEE ALSO
fal(8), decnet.conf(5) DECnet for Linux 8 August 2002 DECNET.CONF(5)
All times are GMT -4. The time now is 09:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy