Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to compare two text files in column wise? Post 302299171 by psiva_arul on Thursday 19th of March 2009 10:47:30 AM
Old 03-19-2009
How to compare two text files in column wise?

Hi All,

I have two txt files like this

File1:
no name
----------
12 aaaa
23 bbbb
55 cccc

File2
dname dno
------------
civil 33
mech 55
arch 66

Now i want to compare col1 from File and col2 from File2, if its match i want fetch all columns from two files.

Expected output:
no name dname dno
----------------------
55 cccc mech 55

How can we do that?

help me on this

Thanks
MPS
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

column compare of files

Hi i want to compare files a.txt 12345,23 34567,76 65456,10 13467,01 b.txt 12346,23 34567,76 23333,90 65456,10 13467,03 i want o/p in 3 files common.txt both have (2 Replies)
Discussion started by: aaysa123
2 Replies

2. Shell Programming and Scripting

URGENT: Script/Function needed to read text property files in block wise

Hi, Iam in a need for a script/function in KSH where I want to read a text file (property file) in block by block. Here is the example: Heading Name Descripton Block Block1 Value1 Description Property Name Value Property Name Value Property Name Value Property Name Value Property Name... (7 Replies)
Discussion started by: ysreenivas
7 Replies

3. Shell Programming and Scripting

Compare files column to column based on keys

Here is my situation. I need to compare two tab separated files (diff is not useful since there could be known difference between files). I have found similar posts , but not fully matching.I was thinking of writing a shell script using cut and grep and while loop but after going thru posts it... (2 Replies)
Discussion started by: blackjack101
2 Replies

4. Shell Programming and Scripting

Combine Multiple text or csv files column-wise

Hi All I am trying to combine columns from multiple text files into a single file using paste command but the record length being unequal in the different files the data is running over to the closest empty cell on the left. Please see below. What can i do to resolve this ? File 1 File... (15 Replies)
Discussion started by: venky_ibm
15 Replies

5. Shell Programming and Scripting

Compare Two Files(Column By Column) In Perl or shell

Hi, I am writing a comparator script, which comapre two txt files(column by column) below are the precondition of this comparator 1)columns of file are not seperated Ex. file1.txt 8888812341181892 1243548895685687 8945896789897789 1111111111111111 file2.txt 9578956789567897... (2 Replies)
Discussion started by: kumar96877
2 Replies

6. Red Hat

How to find a garbage entry in a column wise text file in Linux?

Suppose I have a file containing :- 1 Apple $50 2 Orange $30 3 Banana $10 4 Guava $25 5 Pine@apple $12 6 Strawberry $21 7 Grapes $12 In the 5th row, @ character inserted. I want through sort command or by any other way this row should either on top or bottom. By sort command garbage... (1 Reply)
Discussion started by: Dipankar Mitra
1 Replies

7. Shell Programming and Scripting

Column wise text adding

Hi I have pasted sample data as below:- in data.txt Please suggest any way out: as the 3rd field is cat data.txt 22:37:34 STARTING abc 22:37:40 FAILURE sadn 00:06:42 STARTING asd 00:06:51 FAILURE ad 02:06:38 STARTING acs 02:06:46 FAILURE cz 04:06:35 STARTING xzc... (1 Reply)
Discussion started by: Gaurav198
1 Replies

8. Shell Programming and Scripting

Search string in multiple files and display column wise

I have 3 files. Each of those files have the same number of records, however certain records have different values. I would like to grep the field in ALL 3 files and display the output with only the differences in column wise and if possible line number File1 Name = Joe Age = 33... (3 Replies)
Discussion started by: sidnow
3 Replies

9. UNIX for Advanced & Expert Users

Parse output and then compare column wise with awk

Hello, I am trying to write a script to parse the output of data and then alert based on certain conditions This is the output of my script (STRING) Name = Joe (FLOAT64) BMI = 34 (FLOAT64) Weight = 156 (STRING) Name = Sam (FLOAT64) BMI = 32 (FLOAT64) Weight = 180 and so on it repeats... (4 Replies)
Discussion started by: sidnow
4 Replies

10. Shell Programming and Scripting

Need awk or Shell script to compare Column-1 of two different CSV files and print if column-1 matche

Example: I have files in below format file 1: zxc,133,joe@example.com cst,222,xyz@example1.com File 2 Contains: hxd hcd jws zxc cst File 1 has 50000 lines and file 2 has around 30000 lines : Expected Output has to be : hxd hcd jws (5 Replies)
Discussion started by: TestPractice
5 Replies
mech(4) 							   File Formats 							   mech(4)

NAME
mech, qop - mechanism and QOP files SYNOPSIS
/etc/gss/mech /etc/gss/qop DESCRIPTION
The /etc/gss/mech and /etc/gss/qop files contain tables showing installed security mechanisms and the Quality of Protection (QOP) associ- ated with them, respectively. As security mechanisms are installed on the system, entries are added to these two files. Contents of these files may be accessed either manually or programmatically. For example, manually with cat(1) or more(1), or programmatically with either rpc_gss_get_mechanisms(3NSL) or rpc_gss_get_mech_info(3NSL). The /etc/gss/mech file contains five fields: mechanism name ASCII string representing the mechanism. object identifier RPC OID for this mechanism. shared library Shared library which implements the services provided by this mechanism. kernel module Kernel module which implements the services provided by this mechanism. library options (optional field) Optional parameters that are interpreted by the individual mechanism with which they are associated. Specific supported options are described in the documentation for the individual mechanism, if any. Not all mechanisms have support for optional parameters. library options must be enclosed in brackets ([ ]) so they may be differentiated from the optional kernel module entries. The /etc/gss/qop file contains three fields: QOP string Name, in ASCII, of this Quality of Protection. QOP value Numeric value by which RPC identifies this QOP. mechanism name ASCII string representing the mechanism with which this QOP is associated. EXAMPLES
Example 1: A Typical Entry in /etc/gss/mech This is a typical entry in a /etc/gss/mech file: kerberosv5 1.2.840.113554.1.2.2 mech_krb5.so kmech_krb5 Example 2: A Typical Entry in /etc/gss/qop This is a typical entry in a /etc/gss/qop file: GSS_KRB5_CONF_C_QOP_DES 0 kerberosv5 SEE ALSO
rpc(3NSL), rpc_gss_get_mechanisms(3NSL), rpc_gss_get_mech_info(3NSL), rpcsec_gss(3NSL) ONC+ Developer's Guide SunOS 5.10 13 May 2003 mech(4)
All times are GMT -4. The time now is 02:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy