<?php require_once("SQL.php"); $sql=new SQL();

echo "Started<hr />";
$fh=fopen("../resources/VicDescriptions.txt", "r");
$data = array();
while(!feof($fh)){
	$line=mysql_real_escape_string(strip_tags(trim(fgets($fh))));
	
	$data['period']				 = substr($line, 0,6);
	$data['vic']				 = "'".substr($line, 6,10);//"1"+series+year+make+body
	$data['vicmake']			 = "'".substr($line, 6,2);
	$data['vicyear']			 = "'".substr($line, 8,4);
	$data['vicseries']			 = "'".substr($line, 12,2);
	$data['vicbody']			 = "'".substr($line, 14,2);
	$data['vid']				 = "'".substr($line, 16,11);
	$data['make']				 = "'".substr($line, 27,36);
	$data['model']				 = "'".substr($line, 63,36);
	$data['series']				 = "'".substr($line, 99,36);
	$data['bodystyle']			 = "'".substr($line, 135,36);
	$data['vehiclesegmentcode']	 = "'".substr($line, 171,3);
	$data['modelcode']			 = "'".substr($line, 174,10);
	$data['msrp']				 = "'".substr($line, 184,6);
	$data['weight']				 = "'".substr($line, 190,6);
	$data['gvw']				 = "'".substr($line, 196,6);
	$data['gcw']				 = "'".substr($line, 202,6);
	$data['mileageclass']		 = "'".substr($line, 208,1);
	$data['truckduty']			 = "'".substr($line, 209,1);
	$data['optiontable']		 = "'".substr($line, 210,2);
	$data['sharedtable']		 = "'".substr($line, 212,2);
	$data['bookflag']			 = "'".substr($line, 214,1);
	
	$info = $sql->insertInto("vicdescriptions", $data);
}
echo "<br /><hr />Finished";