I've been working on a project for a few days now and everytime it looks like I'm getting somewhere I hit a dead end. First let me explain the problem.
The general problem is that I have a file that I need to search through for a specific part. IE. Part 0 2, once that part is found I need to scan the components of that part for a specific component number. IE. COMP 4.
If that component is found, I need to remove it.
Sounds pretty easy so far eh?

Well here is where I get tripped up. I have two files that look like the following:

Main (this is the one being searched for the part number)
Code:
PART  0  1
COMP 3
COMP 5
COMP 6
PART  0  2
COMP 1
COMP 2
COMP 4
PART  0  3
COMP 98
COMP 99
Parts (this contains the search criteria)
Code:
PART  0  1  COMP 5
PART  0  1  COMP 6
PART  0  2  COMP 4
PART  0  3  COMP 99
What I have tried to do was basically get the PART number, run through the main file looking for that part number, then once its found search for the COMP number and remove it. I ran into so problems with that and abandoned it for now.
Now I thought I would scan through the main document, copy an entire PART section to a list, scan that list for component numbers and do a list.remove, then write them to a new file. However, I can't seem to get there with this idea, I don't know how to basically run the list against the Parts file successfully.

If any of you can think of a better way to do this, or even just help me with one of my ideas I'd much appreciate it. When I first took on this project it seemed straight forward and easy, but looks tend to be decieving.
Thanks guys
/phalse