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
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
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
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
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
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
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
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
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
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
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