I'm pulling my hair out trying to find out how to upload this data. My files can vary 
in numbers of rows and columns but the x and y axis always contain the same type of 
metadata - in my case cost centre and cost item. A sample of the data would look like :

cost_centre,stationery,postage,furniture,training,advertising
1001,£10.56,£8,£500.99,£1500,£300.99
1002,£40.50,£12.35,£0,£0,£450

My database table is preloaded with a transposed version of the metadata and is 
waiting for the expenditure values :

cost_centre | cost_item | spend
1001           | stationery | .......................(would be populated with 10.56)
1002           | stationery | .......................(would be populated with 40.50)
1001           | postage    | ......................(would be populated with 8)
1002           | stationery | .......................(would be populated with 12)
..........etc.

So I need to parse through the csv file regardless of how many rows or columns and 
insert into my table in the form :

UPDATE EXPENDITURE
   SET SPEND = 10.56
WHERE cost_centre = 1001 AND cost_item = stationery

My attempts so far have been pretty retarded, if you can help at all I'd really 
appreciate it.
Regards,Mark

Reply via email to