Delphi: Deleting records in a MS Excel Spread-Sheet file


[ Delphi Forum -- by DelphiLand ]

Posted by Robert Bebson on November 22, 2003 at 16:50:40:

Hi

I have a .TXT file filled with a list.
I have a MS Excel Spread-Sheet file filled with 3 columns, and lots of records.

I need to search the Spread-Sheet for field matches from the .TXT list. If any fields match, then delete the whole corresponding record.

E.G: Line 1 in the .TXT = "abc". This string needs to be searched throughout the spreadsheet file. If found -E.G it is located (as an exact match) in the field colum 1 row 50. This whole row (record) needs to be deleted.

If there is no match in the spreadsheet for Line 1 of the .TXT ("abc") then move to check Line 2 of the .TXT and delete all matching records etc until you've been through the whole .TXT list.

They need to be exact field matches, EG: If a field contained "abc1234" - that record should stay put. It would be only "abc" records that should be deleted.


I am pretty much a beginner to Delphi, I have limited knowledge - I mean I can do things like string parsing and string deleting in a TStringList, but this database stuff is quite a bit over my head, so I would be looking for simple solutions.

Thanks for your time.

Robert Bebson.


Related Articles and Replies:


[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]