Hi oshoot,
This is how I plan to do this project:
The program can ask the user for the file locations of the four files if you want or I can hard code it.
1. Import the 3 csv files as discussed in chat to database, using the code I would write.
2. Do the processing as discussed in chat (the six points you have mentioned here).
3. Export the 3 tables so you would get final 3 csv files.
So in this process you only have to do is to visit the link, select the xls files and the txt file and hit submit, and then you would get output files.