in a module...

VB Code:
  1. Option Explicit
  2.  
  3. Private Type Players
  4.     Name As String
  5.     Country As String
  6.     Goals As String
  7. End Type
  8.  
  9. Private Type Goals
  10.     Name As String
  11.     Goals As String
  12. End Type
  13.  
  14. Private Sub MergeFiles()
  15.     Dim udtPlayer() As Players
  16.     Dim udtGolas() As Goals
  17.     Dim vSplit As Variant
  18.     Dim ff As Integer
  19.     Dim lLoop As Long
  20.     Dim lRecords As Long
  21.    
  22.     ff = FreeFile
  23.     Open "add.dat" For Input As #ff
  24.     vSplit = Split(Input(LOF(ff), ff), vbCrLf)
  25.     lRecords = UBound(vSplit)
  26.     If Len(vSplit(lRecords)) = 0 Then lRecords = lRecords - 1
  27.     vSplit = Empty
  28.     ReDim udtPlayer(lRecords)
  29.     Seek ff, 1
  30.     For lLoop = 0 To lRecords
  31.         Input #ff, udtPlayer(lLoop).Name, udtPlayer(lLoop).Country
  32.     Next lLoop
  33.     Close ff
  34.    
  35.     ff = FreeFile
  36.     Open "goals.dat" For Input As #ff
  37.     vSplit = Split(Input(LOF(ff), ff), vbCrLf)
  38.     lRecords = UBound(vSplit)
  39.     If Len(vSplit(lRecords)) = 0 Then lRecords = lRecords - 1
  40.     vSplit = Empty
  41.     ReDim udtGolas(lRecords)
  42.     Seek ff, 1
  43.     For lLoop = 0 To lRecords
  44.         Input #ff, udtGolas(lLoop).Name, udtGolas(lLoop).Goals
  45.     Next lLoop
  46.     Close ff
  47.    
  48.     For lLoop = 0 To UBound(udtPlayer)
  49.         For lRecords = 0 To UBound(udtGolas)
  50.             If udtPlayer(lLoop).Name = udtGolas(lRecords).Name Then
  51.                 udtPlayer(lLoop).Goals = udtGolas(lRecords).Goals
  52.             End If
  53.         Next lRecords
  54.     Next lLoop
  55.    
  56.     ff = FreeFile
  57.     Open "final.dat" For Output As #ff
  58.     For lLoop = 0 To UBound(udtPlayer)
  59.         Write #ff, udtPlayer(lLoop).Name, udtPlayer(lLoop).Country, udtPlayer(lLoop).Goals
  60.     Next lLoop
  61.     Close ff
  62. End Sub