Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing files in different formats

Status
Not open for further replies.

ianicr

IS-IT--Management
Nov 4, 2003
230
GB
I have too huge files 600000 lines and 3000000 lines. They are in two completely different formats:

file1
"MR","M",,"DOWIE","47 ORIENT CLOSE"
"MR","J",,"DURHAM","29 ORIENT CLOSE"
"MR","K",,"FINCH","17 ORIENT CLOSE"

file2
,T,Aanchawan,58,Stanhope Rd,,,AL1 5BL,01727865253,
,T,Abass,7, Sudbury Ct,Ramsbury Rd,,,AL1 1SS,01727835996,
,B,Abbott,98,Prospect Rd,,,AL1 2BA,01727763442,

I need to compare fields 2, 3, and 4 in file1 against file2 and print the results in two seperate files, matching and non-matching, anyone know of an easy way to do this?
 
what's the 'common field(s)' in file2?

I'd use nawk and its associative arrays.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top