Help - import multiple OBJs

Hi all, a friend of me made a racing game that has an editor. It is grid based and each grid has an OBJ file associated with that grid. Now, I need to import a track from his game into Blender. Here’s a sample of the track descriptor:

TRACK
h 3 1 0 0
i -2 5 0 0
t 2 5 0 0
l 2 6 0 0

The first character is the OBJ file to read. For example, replace ‘h’ with C:\OBJ\House.obj.
The second is the X position
The third is the Y position
The fourth is the rotation times 90
The fifth is nothing relevant.

I need a script that works like this:

while (not EOF)
read line
if line.beginswith(h):
load C:\OBJ\House.obj file with all default settings (from the import OBJ screen)
move X times… something in the X axis
move Y times… something in the Yaxis
rotate value*90 in Z axis
elif line.beginswith(i):
load another OBJ… the rest is the same
etc…

Is it possible to do it? If it’s not to ask too much, can anyone do it for me? :o Thanks!!

I just join all my models into 1 object, when porting between applications.
If I dont do this, blender assumes I want 5000000000000 duplicates of the exact same material.

It tales less time to manually separate the pieces than it does to re-assign lots of materials,save,close blender,open blender, save again, close blender and open it again…Repeat if you missed any materials.

wish someone would add a “use existing materials if they exist” tickbox in the OBJ importer, it would save me literally days worth of work .