[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

compare 2 flat files.



hi everybody,
    i am opening file 1 and 2 for reading and file 3 for writing.  i
wanted to compare first two files, record wise (line wise) and write the
records which are not in file 2 in file 3.
    the code i am using is as follows :
while 1 = 1
  read 1 into $rec1:50
  while 2 = 1
    read 2 into $rec2:50
    if $rec1 = $rec2
       break
     else
       write 3 from $rec1
    end-if

     if #end-file = 1
       break
    end-if
  end-while
  if #end-file = 1
     break
  end-if
end-while
.

please let me if i can do what i wanted to do by modifying the code
above.
thanx in advance.

ravi c gaddam.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com