Sponsored Content
Top Forums Shell Programming and Scripting Compare two files based on values of fields. Post 302464713 by rdcwayx on Wednesday 20th of October 2010 08:24:32 PM
Old 10-20-2010
what's the point to get the special output format?

If you don't care, use below diff command directly.

Code:
diff <(sort File1) <(sort File2)

1c1
< Dist_Center_file1.txt;21
---
> Dist_Center_file1.txt;23

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

2. UNIX for Dummies Questions & Answers

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

3. Shell Programming and Scripting

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (3 Replies)
Discussion started by: yerruhari
3 Replies

4. UNIX for Dummies Questions & Answers

Compare two flat files and update one based on the values in the other

Hi, I'm a newbie to scripting and am trying to compare two files using awk. The files are exactly the same dimensions. Where the first file has 0's I would like to create an updated version of the second file which has the corresponding elements set to zero also. eg: file1: 12345 1 2 0... (3 Replies)
Discussion started by: kasan0
3 Replies

5. Shell Programming and Scripting

compare fields in different files

HI I'm having some troubles to compare and permut diffrent fields indexed with another filed like the following example `: file1 1 1 2 2 3 3 file2 7 1 9 2 10 3 result------------------- (6 Replies)
Discussion started by: yassinegoth
6 Replies

6. Shell Programming and Scripting

Compare fields in files

Hi, I need the most efficient way of comparing the following and arriving at the result I have a file which has entries like, File1: 1|2|5|7|8|2|3|6|3|1 File2: 1|2|3|1|2|7|9|2 I need to compare the entries in these two file with those of a general file, 1|2|3|5|2|5|6|9|3|1... (7 Replies)
Discussion started by: pradebban
7 Replies

7. Shell Programming and Scripting

Compare values in two files. For matching rows print corresponding values from File 1 in File2.

- I have two files (File 1 and File 2) and the contents of the files are mentioned below. - I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2. - I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies

8. UNIX for Dummies Questions & Answers

Compare values of fields from same column with awk

Hi all ! If there is only one single value in a column (e.g. column 1 below), then return this value in the same output column. If there are several values in the same column (e.g. column 2 below), then return the different values separated by "," in the output. pipe-separated input: ... (11 Replies)
Discussion started by: lucasvs
11 Replies

9. Shell Programming and Scripting

Compare three files based on two fields

Guys, I tried searching on the internet and I couldn't get the answer for this problem. I have 3 files. First 2 fields of all of them are of same type, say they come from various databases but first two fields in the 3 files means the same. I need to verify the entries that are not present... (4 Replies)
Discussion started by: PikK45
4 Replies

10. UNIX for Beginners Questions & Answers

Is there a UNIX command that can compare fields of files with differing number of fields?

Hi, Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account. $ head -500 x.txt y.txt ==> x.txt <== TEST01 APP_USER_PROFILE USER03 APP_USER_PROFILE TEST02 APP_USER_EXP_PROFILE TEST04 APP_USER_PROFILE USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
condor_gather_info(1)					      General Commands Manual					     condor_gather_info(1)

Name
       condor_gather_info Gather - information about a Condor installation and a queued job

Synopsis
       condor_gather_info[ -- jobid<ClusterId.ProcId>] [ -- scratch/path/to/directory]

Description
       NOTE:  The usage information that the Condor versions 7.7.3 and 7.7.4 condor_gather_infotool outputs is not quite correct. This manual page
       is more accurate for those releases.

       condor_gather_infowill collect and output information about the machine it is run upon, about the Condor installation local to the machine,
       and optionally about a specified Condor job. The information gathered by this tool is most often used as a debugging aid for the developers
       of Condor.

       Without the  -- jobidoption, information about the local machine and its Condor installation is gathered and placed into  the  file  called
       condor-profile.txt  ,  in  the  current working directory. Specification of the information gathered is given in the General Remarkssection
       below, under the category of Identity.

       With the  -- jobidoption, additional information is gathered about the job identified by its  ClusterId	and   ProcId  ClassAd  attributes.
       This  information  includes  both categories as given in the General Remarkssection below: Identity and Job information. As the quantity of
       information can be extensive, this information is placed into a compressed tar file. The file is placed into the current working directory,
       and  it is named using the format  cgi-<username>-jid<ClusterId>.<ProcId>-<year>-<month>-<day>-<hour>_<minute>_<second>-<TZ>.tar.gz , where
       all values within  <> are substituted with current values. The building of this potentially large tar file can require  a  fair	amount	of
       temporary  space. If the  -- scratchoption is specified, it identifies a directory in which to build the tar file. If the  -- scratchoption
       is notspecified, then the directory will be  /tmp/cgi-<PID> , where the process ID is that of the condor_gather_infoexecutable.

Options
       --jobid <ClusterId.ProcId>

	  Data mine information about this Condor job from the local Condor installation and condor_schedd.

       --scratch /path/to/directory

	  A path to temporary space needed when building the output tar file. Defaults to  /tmp/cgi-<PID>  ,  where   <PID>  is  replaced  by  the
	  process ID of condor_gather_info .

General Remarks
       The information gathered by this tool is:

	  1. Identity

	     * User name who generated the report

	     * Script location and machine name

	     * Date of report creation

	     *	uname -a

	     * Contents of  /etc/issue

	     * Contents of  /etc/redhat-release

	     * Contents of  /etc/debian_version

	     *	ps -auxww -forest

	     *	df -h

	     *	iptables -L

	     *	ls `condor_config_val LOG`

	     *	ldd `condor_config_val SBIN`/condor_schedd

	     * Contents of  /etc/hosts

	     * Contents of  /etc/nsswitch.conf

	     *	ulimit -a

	     * Network interface configuration ( ifconfig )

	     * Condor version

	     * Location of Condor configuration files

	     * Condor configuration variables

		* All variables and values

		* Definition locations for each configuration variable

	  2. Job Information

	     *	condor_q jobid

	     *	condor_q -l jobid

	     *	condor_q -better-analyze jobid

	     * Job user log, if it exists

		* Only events pertaining to the job ID

Files
	  condor-profile.txt The Identity portion of the information gathered when condor_gather_info is run without arguments.

	  cgi-<username>-jid<cluster>.<proc>-<year>-<month>-<day>-<hour>_<minute>_<second>-<TZ>.tar.gz	The  output file which contains all of the
	  information produced by this tool.

Exit Status
       condor_gather_infowill exit with a status value of 0 (zero) upon success, and it will exit with the value 1 (one) upon failure.

Author
       Condor Team, University of Wisconsin-Madison

Copyright
       Copyright (C) 1990-2012 Condor Team, Computer Sciences Department, University of  Wisconsin-Madison,  Madison,  WI.  All  Rights  Reserved.
       Licensed under the Apache License, Version 2.0.

       See the Condor Version 7.8.2 Manualor http://www.condorproject.org/licensefor additional notices. condor-admin@cs.wisc.edu

								  September 2012					     condor_gather_info(1)
All times are GMT -4. The time now is 10:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy