OK, that was too many details.
I need to either:
take a file that I've generated by a sql query to the database that our software is running off of that contains a list of order numbers (not yet packaged). I've had luck using adosql. Compare it to an exported CSV file created by that software and remove any of the lines that correspond to order numbers in the first file.
so first file contains
I need the resulting file to contain
I could do it the other way around, and remove orders already completed. But by the end of the day, there will be a lot of them.
build my own export file from scratch. I would've done this from the start, but the export file contains something that I can't figure out how to recreate. Basically there is a field the user fills out when entering an order that uses a combination of quick codes and free text. The export file contains a combination of expanded quick codes, looked up in a quick codes table in the database, and free text.
The former seems more obtainable.