I have two text files one file contains values as

Id         Value
1         apple   
2         orange  
3         mango 
4         banana 
5         strawberry
6         papaya

In other file i have

Id        Value
6         strawberry 
4         banana
3         orange  
1         mango
2         papaya
5         straw berry

I have to match between Id's and the corresponding strings in the value column and find the string correctness. How can this be done? Can it be done with shell script or should i follow some other programming.

Recommended Answers

All 4 Replies

What kind of shell? Windows shell? Linux/Unix bash, korn, csh, sh? What?

does anybody say «hello», and «please» any more ?
just «do my stuff», and that's it ?

no "hello"?
no "please"?

no answer !

commented: Ok please guide me +0

I prefer sh. Please guide me how to perform it.

Sheela - Try this
awk -F'|' 'NR==FNR{c[$1$2]++;next};c[$1$2] > 0' file2 file1
- prints the lines from the file1 - which is the default action of the awk command.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.