First step is to manually analyse SEVERAL files to establish rules. You want to know what precisely identifies the elements you are looking for in the files (tags, delimiters, etc)
Once you have identified that your type 1 elements are between delimiterA and delimiterB, it's just a question of looking for those in the files in a loop, and that can be done quite easily with extractstring and similar functions.
After that, you need to test your code against as many files as you can, to check if any strange case is going to break your code