# BE_csv2cpp MS Powershell script by Benny.
 
$addons = "" 
Import-Csv "Addonobjects.csv" | forEach-Object { 
 $cfgVehicleClass = $_.CfgVehicleClass 
 $classname = $_.Classname 
 $model = $_.Model 
  
 $regex = ([regex]"^(?:[^_]*_){3}(.*)").match($classname) 
 $displayName = $regex.Groups[1].Value 
  
 $inheritsFrom = ($cfgVehicleClass -replace "\s","_")+"_BASIC" 
  
$addons += ' 
Class '+$classname+' : '+$inheritsFrom+' { 
 scope = 2;  
 displayName = "'+$displayName+'";  
 model = "'+$model+'"; 
}; 
' 
} 
 
$addons | out-file "Addonconfig.cpp"