Hi I have a requirement like this.
I have two files
This is how data1.txt looks:
EI3171280 38640658501 NENN2005-12-129999-12-312005-12-12HALL NANCY 344 CHENEY HIGHWAY TITUSVILLE FL32780-0000 N 1-1192515160
PI95000M 23326685801 NENN2005-12-121924-02-172005-12-12POLING EARL W 2600-26TH AVE PARKERSBURG WV26101-0000 N 1-1192669087
EI3212756 58007867001 NSNN2005-12-121936-09-192005-12-12CRUZ AIDA P.O. BOX 1295 KINGSHILL,ST. C VI00851 N 1-1193006037
EI3210432 05128396601 NENN2005-12-121933-04-132005-12-12NERKO ELEANORE 60-16-76TH ST ELMHURST NY11373-2417 N 1-1192833610
EI3206592 23560778101 NENN2005-12-121941-08-312005-12-12SLAUGHTER CARL G 452 EAST FAIRLAWN DRIVE COVINGTON VA24426-0000 N 1-1192854020
PI25802 04738568501 NENN2005-12-121947-09-272005-12-12VLECIDES CONSTANTINE 27 WIND HILL WAY HOLMDEL NJ07733-1134 N 1-1192966250
EI3209792 43224032301 NENN2005-12-121916-01-192005-12-12SIMPSON LOUISE E 1102 DALINE SPRINGDALE AR72764-0000 N 1-1192968873
NI2429593 76420731101 NSNN2005-12-121974-01-282005-12-12RAMIREZ PEDRO 414 W PENNSYLVANIA TUCSON AZ85714 N 1-1193264262
EI3309644 61719151504 NSNN2005-12-121999-02-232005-12-12SANDOVAL ANDRES 1727 ROSE AVE SANTA ROSA CA95407-0000 N 1-1193559416
EI3308928 43065868602 NENN2005-12-121968-03-022005-12-12MILLS SR JOHN D 906 HOGAN DR MURFREESBORO TN37128-0000 N 1-1193399232
EI3308972 46825707401 NENN2005-12-121985-03-082005-12-12LEFEVRE STEPHANIE 17175 WALNUT LANE SPIRIT LAKE IA51360-0000 N 1-1193538259
999999 ICARE 2005-12-13 000000011
Please copy it into notepad without wordwrap to have a proper view.
Next data2.txt appears like this:
JI3209792 43224032301 NENN2005-12-121916-01-192005-12-12SIMPSON LOUISE E 1102 DALINE SPRINGDALE AR72764-0000 N 1-1192968873
NI2429593 76420731101 NSNN2005-12-121974-01-282005-12-12RAMIREZ PEDRO 414 W PENNSYLVANIA TUCSON AZ85714 N 1-1193264262
JI3309644 61719151504 NSNN2005-12-121999-02-232005-12-12SANDOVAL ANDRES 1727 ROSE AVE SANTA ROSA CA95407-0000 N 1-1193559416
JI3308928 43065868602 NENN2005-12-121968-03-022005-12-12MILLS SR JOHN D 906 HOGAN DR MURFREESBORO TN37128-0000 N 1-1193399232
JI3308972 46825707401 NENN2005-12-121985-03-082005-12-12LEFEVRE STEPHANIE 17175 WALNUT LANE SPIRIT LAKE IA51360-0000 N 1-1193538259
999999 ICARE 2005-12-13 000000005
So the lines marked in the two files indicates the line count for each file. for the first file its 11 and for the next one its five. This is a common field for both the files.
Now what i need is to merge these two files like this
EI3171280 38640658501 NENN2005-12-129999-12-312005-12-12HALL NANCY 344 CHENEY HIGHWAY TITUSVILLE FL32780-0000 N 1-1192515160
PI95000M 23326685801 NENN2005-12-121924-02-172005-12-12POLING EARL W 2600-26TH AVE PARKERSBURG WV26101-0000 N 1-1192669087
EI3212756 58007867001 NSNN2005-12-121936-09-192005-12-12CRUZ AIDA P.O. BOX 1295 KINGSHILL,ST. C VI00851 N 1-1193006037
EI3210432 05128396601 NENN2005-12-121933-04-132005-12-12NERKO ELEANORE 60-16-76TH ST ELMHURST NY11373-2417 N 1-1192833610
EI3206592 23560778101 NENN2005-12-121941-08-312005-12-12SLAUGHTER CARL G 452 EAST FAIRLAWN DRIVE COVINGTON VA24426-0000 N 1-1192854020
PI25802 04738568501 NENN2005-12-121947-09-272005-12-12VLECIDES CONSTANTINE 27 WIND HILL WAY HOLMDEL NJ07733-1134 N 1-1192966250
EI3209792 43224032301 NENN2005-12-121916-01-192005-12-12SIMPSON LOUISE E 1102 DALINE SPRINGDALE AR72764-0000 N 1-1192968873
NI2429593 76420731101 NSNN2005-12-121974-01-282005-12-12RAMIREZ PEDRO 414 W PENNSYLVANIA TUCSON AZ85714 N 1-1193264262
EI3309644 61719151504 NSNN2005-12-121999-02-232005-12-12SANDOVAL ANDRES 1727 ROSE AVE SANTA ROSA CA95407-0000 N 1-1193559416
EI3308928 43065868602 NENN2005-12-121968-03-022005-12-12MILLS SR JOHN D 906 HOGAN DR MURFREESBORO TN37128-0000 N 1-1193399232
EI3308972 46825707401 NENN2005-12-121985-03-082005-12-12LEFEVRE STEPHANIE 17175 WALNUT LANE SPIRIT LAKE IA51360-0000 N 1-1193538259
JI3209792 43224032301 NENN2005-12-121916-01-192005-12-12SIMPSON LOUISE E 1102 DALINE SPRINGDALE AR72764-0000 N 1-1192968873
NI2429593 76420731101 NSNN2005-12-121974-01-282005-12-12RAMIREZ PEDRO 414 W PENNSYLVANIA TUCSON AZ85714 N 1-1193264262
JI3309644 61719151504 NSNN2005-12-121999-02-232005-12-12SANDOVAL ANDRES 1727 ROSE AVE SANTA ROSA CA95407-0000 N 1-1193559416
JI3308928 43065868602 NENN2005-12-121968-03-022005-12-12MILLS SR JOHN D 906 HOGAN DR MURFREESBORO TN37128-0000 N 1-1193399232
JI3308972 46825707401 NENN2005-12-121985-03-082005-12-12LEFEVRE STEPHANIE 17175 WALNUT LANE SPIRIT LAKE IA51360-0000 N 1-1193538259
999999 ICARE 2005-12-13 000000016
with the count for the merged file changed to 16 now. This is all i need..could you please help me with this.. am very naive in this..
please advise..
thanks