Here's an example on how to read a CSV file into a Map data structure which you can then use to do custom lookup and replacement: viewtopic.php?f=5&t=182
This post includes an example on how to read information from a nearby companion file sharing the same name as the video file: viewtopic.php?f=3&t=2072
I can't really give you a specific solution without knowing any specifics about your use case (i.e. example file / folder structure for testing).
Sure. Using TheTVDB for matching and then adding custom code to your custom format are two entirely separate things that don't exclude each other. A bit of coding skills will help immensely with the latter.