Link to home
Start Free TrialLog in
Avatar of nwteam
nwteam

asked on

Fetch row above current row where.....

I have a importer which imports a feed (csv file) from a supplier (no problem importing it) but the feed layout is different to what i usually get from other suppliers.

Mysql db table:
model | partno | products_name | buy_price | rrp | vendor | product_type | category


CSV Columns:
model | partno | products_name | buy_price | rrp | vendor | product_type


Here is an example of the data in the csv:
HEWLETT-PACKARD - Pavilion Series,,,,,,,,,
CPP3660,FK913AA,HP Pavilion S3660a Intel... ,,,,1,,HEWLETT-PACKARD,Computer Systems
CPP6610A,FK971AA,"HP Pavilion a6610a Intel...,,,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6610,FK971AA,HP Pavilion a6610a Intel... ,,,,5,,HEWLETT-PACKARD,Computer Systems
CPP6640A,FK908AA,"HP Pavilion a6640a Intel...,,,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6640,FK908AA,HP Pavilion a6640a Intel...,,,,5,,HEWLETT-PACKARD,Computer Systems
CPP6710,FT958AA,HP Pavilion a6710a Intel...,,,,9,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6710A,FT958AA,"HP Pavilion a6710a Intel...,,,,,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6730,FT960AA,HP Pavilion a6730a Intel... ,,,,,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - xw4600,,,,,,,,,
CPX4605,KV700EP,HP xw4600 80+ E6850... ,,,,30,,HEWLETT-PACKARD,Computer Systems
CPX4610,NG992PA,HP xw4600 80+ E8400...,,,,16,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - xw6600,,,,,,,,,
CPX6600,FE022AW,HP xw6600 80+ Dual Xeon...,,,,3,,HEWLETT-PACKARD,Computer Systems


As you can see where is says "HEWLETT-PACKARD - HP Series - *****,,,,,,,,," that is the category for the products below.
What i am needing is for the category to be selected and inserted into the column category for each of the products below that category.

I hope what ive explained makes sense.

Thanks in advanced
Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

I suggest you request a new file from the supplier. This is not a valid csv file. The problem is not with the categories on the separate lines, but the fact that there are unbalanced quotes and a different number of fields on some rows. There should be 9 commas on every row, unless it is enclosed in double quotes.
Avatar of nwteam
nwteam

ASKER

My csv importer replaces the quotes out and if there are different number fields in the first post that would probably be because I may have deleted 1 or 2 accidently ( to make the products_name alot shorter). It all imports fine into the table in my database but i'm need a way to get the category to the into the category column for the corrent product.
I agree with cxr.  Your desired query shows 8 fields.  Your expected CSV columns shows 7 fields.  But all the lines have 10 fields (except the ones with the word "NEW" - those have 12 fields).  Palpably something is amiss!
OK, understood.  Please click the "attach code snippet" button and post a sample that is a valid CSV.  It's an easy solution if the data matches the CSV standards.

Best regards, ~Ray
I tried to write code to import the data given, but it does not work because of the errors.

In your csv reader loop, test if field number 2 has a value. If it has not, it is a category row, and you can fetch the category from field number 1. Assign it to a variable. Use this variable for the category column when you insert the row into the database.
@cxr: I did exactly the same thing!
Avatar of nwteam

ASKER

OK here is the csv opened in notepad. My importer replaces out the quotemarks, I have not edited this code as i did with the one in the first post hopefully this helps.
Computer Systems - Workstations,,,,,,,,,
HEWLETT-PACKARD - Pavilion Series,,,,,,,,,
CPP3660,FK913AA,HP Pavilion S3660a Intel E7300 2GB 360 Vista Prem Intel Core 2 Duo E7300 2.66GHz 2GB 360GB 7200 DVDRW SM DL LS Vista Home Premium ,1155.00,1546.67,,1,,HEWLETT-PACKARD,Computer Systems
CPP6610A,FK971AA,HP Pavilion a6610a Intel E2220 2GB 250 VPrem+22"W Intel Dual Core E2220 2.4GHz 2GB 250GB SuperMulti SATA Drive LS DL Vista Home Premium Plus V220 22" Wide LCD Monitor ,1288.00,1728.57,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6610,FK971AA,HP Pavilion a6610a Intel E2220 2GB 250 Vista Prem Intel Dual Core E2220 2.4GHz 2GB 250GB SuperMulti SATA Drive LS DL Vista Home Premium ,895.00,1200.00,,5,,HEWLETT-PACKARD,Computer Systems
CPP6640A,FK908AA,HP Pavilion a6640a Intel E7300 2GB 500 VPrem+20"W Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200 SuperMulti DVDRW DL LS Vista Home Premium Plus  v220 22" Wide LCD Monitor ,1539.00,2063.81,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6640,FK908AA,HP Pavilion a6640a Intel E7300 2GB 500 Vista Prem Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200 SuperMulti DVDRW DL LS Vista Home Premium ,1145.00,1535.24,,5,,HEWLETT-PACKARD,Computer Systems
CPP6710,FT958AA,HP Pavilion a6710a Intel E2220 2GB 250 Vista Home Intel Dual Core E2220 2.4GHz 2GB 250GB 7200 DVDRW SM DL LS Vista Home Basic ,905.00,1314.29,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6710A,FT958AA,HP Pavilion a6710a Intel E2220 2GB 250 VistaHM+22" Intel Dual Core E2220 2.4GHz 2GB 250GB 7200 DVDRW SM DL LS Vista Home Basic Plus V220 22" Wide LCD Monitor ,1330.00,1885.72,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6730,FT960AA,HP Pavilion a6730a Intel E2220 2GB 320 Vista Home Intel Dual Core E2220 2.4GHz 2GB 320GB 7200 DVDRW SM DL LS Vista Home Premium ,1079.00,1583.49,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6730A,FT960AA,HP Pavilion a6730a Intel E2220 2GB 320 VistaHM+22" Intel Dual Core E2220 2.4GHz 2GB 320GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22" Wide LCD Monitor ,1504.00,2154.92,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6740,FT961AA,HP Pavilion a6740a Intel E7400 2GB 500 Vista Home Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium ,1235.00,1801.90,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6740A,FT961AA,HP Pavilion a6740a Intel E7400 2GB 500 VistaHM+22" Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22" Wide LCD Monitor ,1660.00,2373.33,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP6760,FT962AA,HP Pavilion a6760a Intel E7400 2GB 500 Vista Home Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium ,1349.00,1973.33,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6760A,FT962AA,HP Pavilion a6760a Intel E7400 2GB 500 VistaHM+22" Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22" Wide LCD Monitor ,1774.00,2544.76,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP9590,FT964AA,HP Pavilion m9590a Intel Q9400 8GB 2000 Vista Home Intel Core 2 Quad Q9400 2.66GHz 8GB 2000GB 5400 Blu-Ray DVD Burner SM LS Vista Home Premium 64bit Media Centre PC ,2669.00,4008.89,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP9590A,FT964AA,HP Pavilion m9590a Intel Q9400 8GB 2000 VistaHM+22 Intel Core 2 Quad Q9400 2.66GHz 8GB 2000GB 5400 Blu-Ray DVD Burner SM LS Vista Home Premium 64bit Media Centre PC Plus V220 22" Wide LCD Monitor ,3094.00,4580.32,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP3680A,FK914AA,HP Pavilion s3680a E7300 2GB 500 Blu-ray VP+20"W Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200  Blu-ray SuperMulti DVDRW LS Vista Home Premium Plus v220 22" Wide LCD Monitor ,1725.00,2311.43,,4,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP3680,FK914AA,HP Pavilion s3680a Intel E7300 2GB 500 Blu-ray VP Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200  Blu-ray SuperMulti DVDRW LS Vista Home Premium ,1329.00,1782.86,,4,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - xw4600,,,,,,,,,
CPX4605,KV700EP,HP xw4600 80+ E6850 4GB 250GB DVDROM FX1700 XPP DG Intel Core 2 Duo E6850 4GB 250GB FX1700 DVDROM Vista Business 32bit with XPPro Downgrade  ,2075.00,2350.00,,30,,HEWLETT-PACKARD,Computer Systems
CPX4610,NG992PA,HP xw4600 80+ E8400 2GB 160GB DVDRW FX570 XPP DG Intel Core 2 Duo E8400 2GB 160GB FX570 DVDRW Vista Business 32bit with XPPro Downgrade ,1799.00,2050.00,,16,,HEWLETT-PACKARD,Computer Systems
CPX4609,NG991PA,HP xw4600 80+ E8400 2GB 160GB DVDRW NVS290 XPP DG Intel Core 2 Duo E8400 2GB 160GB NVS290 DVDRW Vista Business 32bit with XPPro Downgrade ,1630.00,1850.00,,92,,HEWLETT-PACKARD,Computer Systems
CPX4611,NG993PA,HP xw4600 80+ Q9550 4GB 160GB DVDRW FX1700 XPP DG Intel Quad Core Q9550 4GB 160GB FX1700 DVDRW Vista Business 32bit with XPPro Downgrade ,2640.00,2995.00,,12,,HEWLETT-PACKARD,Computer Systems
CPX4612,NG994PA,HP xw4600 80+ Q9650 4GB 250GB DVDRW ATI V7700 XPDG Intel Quad Core Q9650 4GB 250GB ATI V7700 512MB Vista Business 32bit with XPPro Downgrade ,3199.00,4150.00,-134.00,16,,HEWLETT-PACKARD,Computer Systems
CPX4614,NK741PC,HP xw4600 E8400 2GB 80 250 FX1700 XP32 AdobePrem 80+ Intel E8400 2GB 80GB+250GB FX1700 DVDRW Vista Business with XPP32 Install Adobe Production Premium CS4 ,3880.00,4395.00,,1,,HEWLETT-PACKARD,Computer Systems
CPX4613,NK743PC,HP xw4600 Q9550 2GB 80 250x2 FX1700 XP64 AdobePrem 80+ Intel Q9550 2GB 80GB+250GB+250GB FX1700 DVDRW Vista Business with XPP64 Install Adobe Production Premium CS4 ,4300.00,4895.00,,1,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - xw6600,,,,,,,,,
CPX6600,FE022AW,HP xw6600 80+ Dual Xeon E5410 4GB 80 DVD NVS290 XP Dual Xeon E5410 4GB 80GB DVDROM NVS290 Vista Business With XPPro 32 Downgrade Microtower ,3575.00,4050.00,,3,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - Thin Client,,,,,,,,,
HDT5145A,FL483PA,HP T5145 TCnet 500MHz 128F 512 VESA AUST + 17" LCD Plus L1710 17" LCD Monitor ,670.00,800.00,,77,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5145B,FL483PA,HP T5145 TCnet 500MHz 128F 512 VESA AUST + 19" LCD Plus L1910 19" LCD Monitor ,705.00,850.00,,77,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5145,FL483PA,HP T5145 TCnet 500MHz 128F 512MB ,425.00,480.00,,77,,HEWLETT-PACKARD,Computer Systems
HDT5530,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client ,455.00,515.00,,169,,HEWLETT-PACKARD,Computer Systems
HDT5530D,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+17" Plus L1710 17" LCD Monitor ,690.00,835.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530C,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+19" Plus L1910 19" LCD Monitor ,735.00,885.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530F,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+19"W Plus L1908wm 19" Wide   ,720.00,885.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530G,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+20"W Plus L2045W 20" Wide LCD Monitor ,770.00,815.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540A,FL484PA,HP t5540 CE 1GHz 128F/512R (VESA) TC + 17" LCD Plus L1710 17" LCD Monitor ,740.00,900.00,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540B,FL484PA,HP t5540 CE 1GHz 128F/512R (VESA) TC + 19" LCD Plus L1910 19" LCD Monitor ,775.00,950.00,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client ,510.00,580.00,,286,,HEWLETT-PACKARD,Computer Systems
HDT5540C,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client+19"Wide Plus HP L1908wm 19" Wide LCD Monitor with Speakers ,745.00,950.00,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540D,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client+20"Wide Plus HP L2045W 20" Wide TFT Display LCD Monitor DVI Carbonite black and silver (two-tone) Monitor Doesn't ship with DVI Cable ,805.00,1005.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545A,FL481PA,HP t5545 1GHz 512F/512R (VESA) Linux +17" LCD Plus L1710 17" LCD Monitor ,750.00,885.00,,46,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545,FL481PA,HP t5545 Linux 512F/512R Thin Client ,500.00,565.00,,46,,HEWLETT-PACKARD,Computer Systems
HDT5630,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC ,590.00,670.00,,19,,HEWLETT-PACKARD,Computer Systems
HDT5630A,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC AUST + 17" LCD Plus L1710 17" LCD Monitor ,863.00,1010.00,,19,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5630B,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC AUST + 19" LCD Plus L1910 19" LCD Monitor ,895.00,1060.00,,19,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5730,KD219AA,HP t5730 S2100 1GB 512MB Thin Client XPE ,665.00,750.00,,102,,HEWLETT-PACKARD,Computer Systems
HDT5730A,KD219AA,HP t5730 S2100 1GB 512MB Thin Client XPE +17" LCD ,885.00,1070.00,,102,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5730B,KD219AA,HP t5730 S2100 1GB 512MB Thin Client+ 19"LCD XPE ,920.00,1120.00,,102,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731,GY227AA,HP t5730 S2100 1GF/1GR Thin Client ,700.00,795.00,,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731A,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L1710 17"LCD ,970.00,1105.00,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731B,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L1910 19"LCD ,990.00,1155.00,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731C,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L2045w LCD ,1050.00,1205.00,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5732,GY229AA,HP t5730 S2100 1GF/512R wifi Thin Client ,660.00,785.00,,2,,HEWLETT-PACKARD,Computer Systems
HDT5735,GY231AA,HP t5735 S2100 1GB 512MB Thin Client Linux ,570.00,645.00,,5,,HEWLETT-PACKARD,Computer Systems
HDT5735A,GY231AA,HP t5735 S2100 1GB 512MB Thin Client+L1710 17"LCD ,820.00,965.00,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5735B,GY231AA,HP t5735 S2100 1GB 512MB Thin Client+L1910 19"LCD ,850.00,1015.00,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545B,FL481PA,t5545 LNX 1GHz 512F/512R (VESA) AUST + 19" LCD Plus L1910 19" LCD Monitor ,780.00,935.00,,46,23.01.2009,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx7400 Value Series - Micro Tower,,,,,,,,,
HDT7422A,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor   ,1340.00,1800.00,,250,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422B,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor   ,1375.00,1840.00,35.00,249,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422C,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+19"W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers   ,1355.00,1820.00,,250,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422D,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+20"W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor   ,1415.00,1905.00,60.00,183,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade   ,1250.00,1430.00,,249,,HEWLETT-PACKARD,Computer Systems
HDT7424,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW GF8400DH XPP DG GF8400DH Microtower Vista Business with XPPro Downgrade  ,1675.00,1830.00,506.00,0,03.02.2009,HEWLETT-PACKARD,Computer Systems
HDT7424A,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+17"LCD GF8400DH Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor   ,1640.00,2200.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT7424B,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+19"LCD GF8400DH Microtower Vista Business with XPPro Downgrade HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro   ,1670.00,2240.00,30.00,0,,HEWLETT-PACKARD,Computer Systems
HDT7424C,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+19"W GF8400DH Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers ,1655.00,2220.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT7424D,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+20"W GF8400DH Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor   ,1710.00,2305.00,55.00,0,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx7400 Value Series - Small Form Factor,,,,,,,,,
HDT7423C,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPP DG+19"W Small Form Factor Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers ,1355.00,1820.00,,261,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7423,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPP Downgrade Small Form Factor Vista Business with XPPro Downgrade  ,1250.00,1430.00,,261,,HEWLETT-PACKARD,Computer Systems
HDT7423A,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPPro DG+17" Small Form Factor Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor   ,1340.00,1800.00,,261,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7423B,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPPro DG+19" Small Form Factor Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor   ,1375.00,1840.00,35.00,261,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7423D,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPPro DG+20"W Small Form Factor Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor   ,1415.00,1905.00,60.00,184,23.01.2009,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx2355 AMD Series,,,,,,,,,
HDT1122,FH291PA,HP dx2355 MT AMD LE-1300 80GB 1GB DVD Vista Home AMD Sempron LE-1300 80GB 1GB DVDROM Vista Home Basic  3 Year ONSITE NBD Warranty ONLY WHILE STOCKS LAST ,480.00,555.00,-19.00,10,,HEWLETT-PACKARD,Computer Systems
HDT2359,KY419PA,HP dx2355 MT Ath 5200B 160GB 1GB DVDRW Vista Bus Microtower Vista Business Vista Business plus XPPro Recovery Media in Box ,790.00,920.00,-35.00,1,,HEWLETT-PACKARD,Computer Systems
HDT2362A,FX890PA,HP dx2355 MT Ath 5200B 1GB 160 DVDRW XPP DG+17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1145.00,1450.00,-5.00,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362B,FX890PA,HP dx2355 MT Ath 5200B 1GB 160 DVDRW XPP DG+19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1180.00,1490.00,,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362C,FX890PA,HP dx2355 MT Ath 5200B 1GB 160GB DVDRW XPP DG+19"W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,1160.00,1470.00,-20.00,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362D,FX890PA,HP dx2355 MT Ath 5200B 1GB 160GB DVDRW XPP DG+20"W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor ,1215.00,1555.00,,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362,FX890PA,HP dx2355 MT Ath 5200B 1GB 160GB DVDRW XPPro DG Microtower Vista Business with XPPro Downgrade ,940.00,1080.00,,145,,HEWLETT-PACKARD,Computer Systems
HDT2357,FH209PA,HP dx2355 MT Phenom 8600 160GB 2GB DVDRW XPPro DG Microtower Vista Business Downgrade to XPPro ,920.00,1075.00,-50.00,2,,HEWLETT-PACKARD,Computer Systems
HDT2363C,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBaisc+19W Microtower Vista Basic Plus L1908wm 19" Wide LCD Monitor ,955.00,1245.00,-20.00,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363A,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBasic+17" Microtower Vista Basic Plus L1710 17" LCD Monitor ,940.00,1225.00,-320.00,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363B,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBasic+19" Microtower Vista Basic Plus L1910 19" LCD Monitor ,975.00,1265.00,,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363D,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBasic+20W Microtower Vista Basic Plus L2045W 20" Wide LCD Monitor ,1015.00,1330.00,,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361A,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+17" Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1075.00,1360.00,60.00,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361B,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+19" Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1110.00,1400.00,,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361C,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+19W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,1090.00,1380.00,-20.00,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361D,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+20W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor ,1150.00,1465.00,,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160GB DVDRW VBasic Microtower Vista Basic ,675.00,855.00,,10,,HEWLETT-PACKARD,Computer Systems
HDT2361,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160GB DVDRW XPPro DG Microtower Vista Business with XPPro Downgrade ,865.00,990.00,,150,,HEWLETT-PACKARD,Computer Systems
HDT2355C,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XP DG+19W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,945.00,1155.00,,11,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355D,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XP DG+20W Microtower Vista Business with XPPro Downgrade Plus L2045w 20" Wide LCD Monitor ,995.00,1225.00,,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355A,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XPP DG+17 Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,930.00,1125.00,,11,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355B,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XPP DG+19 Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,970.00,1175.00,,8,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XPPro DG Microtower Vista Business with XPPro Downgrade ,715.00,795.00,,10,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx2710 Series - Micro Tower,,,,,,,,,
HDT2727A,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG +17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1040.00,1455.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2727B,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG +19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1075.00,1495.00,35.00,0,,HEWLETT-PACKARD,Computer Systems
HDT2727C,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG+19"Wide Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,1065.00,1475.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2727D,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG+20"Wide Microtower Vista Business with XPPro Downgrade Plus L2045w 20" Wide LCD Monitor ,1115.00,1560.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2727,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade ,999.00,1085.00,,0,03.02.2009,HEWLETT-PACKARD,Computer Systems
HDT2724A,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1178.00,1655.00,63.00,144,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2724B,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1201.00,1695.00,,144,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2724C,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+19"W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers ,1199.00,1675.00,-2.00,0,,HEWLETT-PACKARD,Computer Systems
HDT2724D,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+20"W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor ,1260.00,1760.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2724,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade ,1120.00,1285.00,,144,,HEWLETT-PACKARD,Computer Systems

Open in new window

Avatar of nwteam

ASKER

Sorry the csv columns are as follows

model | partno | products_name | buy_price | rrp | | quantity | | vendor | product_type

also i believe there is a column in the above code after the last comma,

// SEE IF THE DATA HAS THE RIGHT NUMBER OF FIELDS

Open in new window

Sheesh, I'm an idiot.  Select all !== select all, copy.
This constructs the CSV into a big array with the categories as the last element of each line.  Does that make sense? ~Ray
<?php // RAY_temp_odd_csv.php
 
// TEST DATA
$testdata = 'Computer Systems - Workstations,,,,,,,,,
HEWLETT-PACKARD - Pavilion Series,,,,,,,,,
CPP3660,FK913AA,HP Pavilion S3660a Intel E7300 2GB 360 Vista Prem Intel Core 2 Duo E7300 2.66GHz 2GB 360GB 7200 DVDRW SM DL LS Vista Home Premium ,1155.00,1546.67,,1,,HEWLETT-PACKARD,Computer Systems
CPP6610A,FK971AA,HP Pavilion a6610a Intel E2220 2GB 250 VPrem+22"W Intel Dual Core E2220 2.4GHz 2GB 250GB SuperMulti SATA Drive LS DL Vista Home Premium Plus V220 22" Wide LCD Monitor ,1288.00,1728.57,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6610,FK971AA,HP Pavilion a6610a Intel E2220 2GB 250 Vista Prem Intel Dual Core E2220 2.4GHz 2GB 250GB SuperMulti SATA Drive LS DL Vista Home Premium ,895.00,1200.00,,5,,HEWLETT-PACKARD,Computer Systems
CPP6640A,FK908AA,HP Pavilion a6640a Intel E7300 2GB 500 VPrem+20"W Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200 SuperMulti DVDRW DL LS Vista Home Premium Plus  v220 22" Wide LCD Monitor ,1539.00,2063.81,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6640,FK908AA,HP Pavilion a6640a Intel E7300 2GB 500 Vista Prem Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200 SuperMulti DVDRW DL LS Vista Home Premium ,1145.00,1535.24,,5,,HEWLETT-PACKARD,Computer Systems
CPP6710,FT958AA,HP Pavilion a6710a Intel E2220 2GB 250 Vista Home Intel Dual Core E2220 2.4GHz 2GB 250GB 7200 DVDRW SM DL LS Vista Home Basic ,905.00,1314.29,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6710A,FT958AA,HP Pavilion a6710a Intel E2220 2GB 250 VistaHM+22" Intel Dual Core E2220 2.4GHz 2GB 250GB 7200 DVDRW SM DL LS Vista Home Basic Plus V220 22" Wide LCD Monitor ,1330.00,1885.72,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6730,FT960AA,HP Pavilion a6730a Intel E2220 2GB 320 Vista Home Intel Dual Core E2220 2.4GHz 2GB 320GB 7200 DVDRW SM DL LS Vista Home Premium ,1079.00,1583.49,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6730A,FT960AA,HP Pavilion a6730a Intel E2220 2GB 320 VistaHM+22" Intel Dual Core E2220 2.4GHz 2GB 320GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22" Wide LCD Monitor ,1504.00,2154.92,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6740,FT961AA,HP Pavilion a6740a Intel E7400 2GB 500 Vista Home Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium ,1235.00,1801.90,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6740A,FT961AA,HP Pavilion a6740a Intel E7400 2GB 500 VistaHM+22" Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22" Wide LCD Monitor ,1660.00,2373.33,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP6760,FT962AA,HP Pavilion a6760a Intel E7400 2GB 500 Vista Home Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium ,1349.00,1973.33,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6760A,FT962AA,HP Pavilion a6760a Intel E7400 2GB 500 VistaHM+22" Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22" Wide LCD Monitor ,1774.00,2544.76,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP9590,FT964AA,HP Pavilion m9590a Intel Q9400 8GB 2000 Vista Home Intel Core 2 Quad Q9400 2.66GHz 8GB 2000GB 5400 Blu-Ray DVD Burner SM LS Vista Home Premium 64bit Media Centre PC ,2669.00,4008.89,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP9590A,FT964AA,HP Pavilion m9590a Intel Q9400 8GB 2000 VistaHM+22 Intel Core 2 Quad Q9400 2.66GHz 8GB 2000GB 5400 Blu-Ray DVD Burner SM LS Vista Home Premium 64bit Media Centre PC Plus V220 22" Wide LCD Monitor ,3094.00,4580.32,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP3680A,FK914AA,HP Pavilion s3680a E7300 2GB 500 Blu-ray VP+20"W Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200  Blu-ray SuperMulti DVDRW LS Vista Home Premium Plus v220 22" Wide LCD Monitor ,1725.00,2311.43,,4,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP3680,FK914AA,HP Pavilion s3680a Intel E7300 2GB 500 Blu-ray VP Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200  Blu-ray SuperMulti DVDRW LS Vista Home Premium ,1329.00,1782.86,,4,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - xw4600,,,,,,,,,
CPX4605,KV700EP,HP xw4600 80+ E6850 4GB 250GB DVDROM FX1700 XPP DG Intel Core 2 Duo E6850 4GB 250GB FX1700 DVDROM Vista Business 32bit with XPPro Downgrade  ,2075.00,2350.00,,30,,HEWLETT-PACKARD,Computer Systems
CPX4610,NG992PA,HP xw4600 80+ E8400 2GB 160GB DVDRW FX570 XPP DG Intel Core 2 Duo E8400 2GB 160GB FX570 DVDRW Vista Business 32bit with XPPro Downgrade ,1799.00,2050.00,,16,,HEWLETT-PACKARD,Computer Systems
CPX4609,NG991PA,HP xw4600 80+ E8400 2GB 160GB DVDRW NVS290 XPP DG Intel Core 2 Duo E8400 2GB 160GB NVS290 DVDRW Vista Business 32bit with XPPro Downgrade ,1630.00,1850.00,,92,,HEWLETT-PACKARD,Computer Systems
CPX4611,NG993PA,HP xw4600 80+ Q9550 4GB 160GB DVDRW FX1700 XPP DG Intel Quad Core Q9550 4GB 160GB FX1700 DVDRW Vista Business 32bit with XPPro Downgrade ,2640.00,2995.00,,12,,HEWLETT-PACKARD,Computer Systems
CPX4612,NG994PA,HP xw4600 80+ Q9650 4GB 250GB DVDRW ATI V7700 XPDG Intel Quad Core Q9650 4GB 250GB ATI V7700 512MB Vista Business 32bit with XPPro Downgrade ,3199.00,4150.00,-134.00,16,,HEWLETT-PACKARD,Computer Systems
CPX4614,NK741PC,HP xw4600 E8400 2GB 80 250 FX1700 XP32 AdobePrem 80+ Intel E8400 2GB 80GB+250GB FX1700 DVDRW Vista Business with XPP32 Install Adobe Production Premium CS4 ,3880.00,4395.00,,1,,HEWLETT-PACKARD,Computer Systems
CPX4613,NK743PC,HP xw4600 Q9550 2GB 80 250x2 FX1700 XP64 AdobePrem 80+ Intel Q9550 2GB 80GB+250GB+250GB FX1700 DVDRW Vista Business with XPP64 Install Adobe Production Premium CS4 ,4300.00,4895.00,,1,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - xw6600,,,,,,,,,
CPX6600,FE022AW,HP xw6600 80+ Dual Xeon E5410 4GB 80 DVD NVS290 XP Dual Xeon E5410 4GB 80GB DVDROM NVS290 Vista Business With XPPro 32 Downgrade Microtower ,3575.00,4050.00,,3,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - Thin Client,,,,,,,,,
HDT5145A,FL483PA,HP T5145 TCnet 500MHz 128F 512 VESA AUST + 17" LCD Plus L1710 17" LCD Monitor ,670.00,800.00,,77,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5145B,FL483PA,HP T5145 TCnet 500MHz 128F 512 VESA AUST + 19" LCD Plus L1910 19" LCD Monitor ,705.00,850.00,,77,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5145,FL483PA,HP T5145 TCnet 500MHz 128F 512MB ,425.00,480.00,,77,,HEWLETT-PACKARD,Computer Systems
HDT5530,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client ,455.00,515.00,,169,,HEWLETT-PACKARD,Computer Systems
HDT5530D,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+17" Plus L1710 17" LCD Monitor ,690.00,835.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530C,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+19" Plus L1910 19" LCD Monitor ,735.00,885.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530F,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+19"W Plus L1908wm 19" Wide   ,720.00,885.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530G,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+20"W Plus L2045W 20" Wide LCD Monitor ,770.00,815.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540A,FL484PA,HP t5540 CE 1GHz 128F/512R (VESA) TC + 17" LCD Plus L1710 17" LCD Monitor ,740.00,900.00,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540B,FL484PA,HP t5540 CE 1GHz 128F/512R (VESA) TC + 19" LCD Plus L1910 19" LCD Monitor ,775.00,950.00,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client ,510.00,580.00,,286,,HEWLETT-PACKARD,Computer Systems
HDT5540C,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client+19"Wide Plus HP L1908wm 19" Wide LCD Monitor with Speakers ,745.00,950.00,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540D,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client+20"Wide Plus HP L2045W 20" Wide TFT Display LCD Monitor DVI Carbonite black and silver (two-tone) Monitor Doesn\'t ship with DVI Cable ,805.00,1005.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545A,FL481PA,HP t5545 1GHz 512F/512R (VESA) Linux +17" LCD Plus L1710 17" LCD Monitor ,750.00,885.00,,46,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545,FL481PA,HP t5545 Linux 512F/512R Thin Client ,500.00,565.00,,46,,HEWLETT-PACKARD,Computer Systems
HDT5630,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC ,590.00,670.00,,19,,HEWLETT-PACKARD,Computer Systems
HDT5630A,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC AUST + 17" LCD Plus L1710 17" LCD Monitor ,863.00,1010.00,,19,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5630B,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC AUST + 19" LCD Plus L1910 19" LCD Monitor ,895.00,1060.00,,19,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5730,KD219AA,HP t5730 S2100 1GB 512MB Thin Client XPE ,665.00,750.00,,102,,HEWLETT-PACKARD,Computer Systems
HDT5730A,KD219AA,HP t5730 S2100 1GB 512MB Thin Client XPE +17" LCD ,885.00,1070.00,,102,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5730B,KD219AA,HP t5730 S2100 1GB 512MB Thin Client+ 19"LCD XPE ,920.00,1120.00,,102,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731,GY227AA,HP t5730 S2100 1GF/1GR Thin Client ,700.00,795.00,,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731A,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L1710 17"LCD ,970.00,1105.00,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731B,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L1910 19"LCD ,990.00,1155.00,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731C,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L2045w LCD ,1050.00,1205.00,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5732,GY229AA,HP t5730 S2100 1GF/512R wifi Thin Client ,660.00,785.00,,2,,HEWLETT-PACKARD,Computer Systems
HDT5735,GY231AA,HP t5735 S2100 1GB 512MB Thin Client Linux ,570.00,645.00,,5,,HEWLETT-PACKARD,Computer Systems
HDT5735A,GY231AA,HP t5735 S2100 1GB 512MB Thin Client+L1710 17"LCD ,820.00,965.00,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5735B,GY231AA,HP t5735 S2100 1GB 512MB Thin Client+L1910 19"LCD ,850.00,1015.00,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545B,FL481PA,t5545 LNX 1GHz 512F/512R (VESA) AUST + 19" LCD Plus L1910 19" LCD Monitor ,780.00,935.00,,46,23.01.2009,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx7400 Value Series - Micro Tower,,,,,,,,,
HDT7422A,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor   ,1340.00,1800.00,,250,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422B,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor   ,1375.00,1840.00,35.00,249,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422C,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+19"W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers   ,1355.00,1820.00,,250,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422D,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+20"W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor   ,1415.00,1905.00,60.00,183,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade   ,1250.00,1430.00,,249,,HEWLETT-PACKARD,Computer Systems
HDT7424,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW GF8400DH XPP DG GF8400DH Microtower Vista Business with XPPro Downgrade  ,1675.00,1830.00,506.00,0,03.02.2009,HEWLETT-PACKARD,Computer Systems
HDT7424A,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+17"LCD GF8400DH Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor   ,1640.00,2200.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT7424B,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+19"LCD GF8400DH Microtower Vista Business with XPPro Downgrade HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro   ,1670.00,2240.00,30.00,0,,HEWLETT-PACKARD,Computer Systems
HDT7424C,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+19"W GF8400DH Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers ,1655.00,2220.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT7424D,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+20"W GF8400DH Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor   ,1710.00,2305.00,55.00,0,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx7400 Value Series - Small Form Factor,,,,,,,,,
HDT7423C,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPP DG+19"W Small Form Factor Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers ,1355.00,1820.00,,261,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7423,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPP Downgrade Small Form Factor Vista Business with XPPro Downgrade  ,1250.00,1430.00,,261,,HEWLETT-PACKARD,Computer Systems
HDT7423A,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPPro DG+17" Small Form Factor Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor   ,1340.00,1800.00,,261,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7423B,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPPro DG+19" Small Form Factor Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor   ,1375.00,1840.00,35.00,261,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7423D,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPPro DG+20"W Small Form Factor Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor   ,1415.00,1905.00,60.00,184,23.01.2009,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx2355 AMD Series,,,,,,,,,
HDT1122,FH291PA,HP dx2355 MT AMD LE-1300 80GB 1GB DVD Vista Home AMD Sempron LE-1300 80GB 1GB DVDROM Vista Home Basic  3 Year ONSITE NBD Warranty ONLY WHILE STOCKS LAST ,480.00,555.00,-19.00,10,,HEWLETT-PACKARD,Computer Systems
HDT2359,KY419PA,HP dx2355 MT Ath 5200B 160GB 1GB DVDRW Vista Bus Microtower Vista Business Vista Business plus XPPro Recovery Media in Box ,790.00,920.00,-35.00,1,,HEWLETT-PACKARD,Computer Systems
HDT2362A,FX890PA,HP dx2355 MT Ath 5200B 1GB 160 DVDRW XPP DG+17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1145.00,1450.00,-5.00,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362B,FX890PA,HP dx2355 MT Ath 5200B 1GB 160 DVDRW XPP DG+19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1180.00,1490.00,,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362C,FX890PA,HP dx2355 MT Ath 5200B 1GB 160GB DVDRW XPP DG+19"W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,1160.00,1470.00,-20.00,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362D,FX890PA,HP dx2355 MT Ath 5200B 1GB 160GB DVDRW XPP DG+20"W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor ,1215.00,1555.00,,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362,FX890PA,HP dx2355 MT Ath 5200B 1GB 160GB DVDRW XPPro DG Microtower Vista Business with XPPro Downgrade ,940.00,1080.00,,145,,HEWLETT-PACKARD,Computer Systems
HDT2357,FH209PA,HP dx2355 MT Phenom 8600 160GB 2GB DVDRW XPPro DG Microtower Vista Business Downgrade to XPPro ,920.00,1075.00,-50.00,2,,HEWLETT-PACKARD,Computer Systems
HDT2363C,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBaisc+19W Microtower Vista Basic Plus L1908wm 19" Wide LCD Monitor ,955.00,1245.00,-20.00,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363A,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBasic+17" Microtower Vista Basic Plus L1710 17" LCD Monitor ,940.00,1225.00,-320.00,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363B,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBasic+19" Microtower Vista Basic Plus L1910 19" LCD Monitor ,975.00,1265.00,,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363D,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBasic+20W Microtower Vista Basic Plus L2045W 20" Wide LCD Monitor ,1015.00,1330.00,,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361A,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+17" Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1075.00,1360.00,60.00,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361B,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+19" Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1110.00,1400.00,,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361C,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+19W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,1090.00,1380.00,-20.00,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361D,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+20W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor ,1150.00,1465.00,,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160GB DVDRW VBasic Microtower Vista Basic ,675.00,855.00,,10,,HEWLETT-PACKARD,Computer Systems
HDT2361,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160GB DVDRW XPPro DG Microtower Vista Business with XPPro Downgrade ,865.00,990.00,,150,,HEWLETT-PACKARD,Computer Systems
HDT2355C,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XP DG+19W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,945.00,1155.00,,11,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355D,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XP DG+20W Microtower Vista Business with XPPro Downgrade Plus L2045w 20" Wide LCD Monitor ,995.00,1225.00,,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355A,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XPP DG+17 Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,930.00,1125.00,,11,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355B,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XPP DG+19 Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,970.00,1175.00,,8,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XPPro DG Microtower Vista Business with XPPro Downgrade ,715.00,795.00,,10,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx2710 Series - Micro Tower,,,,,,,,,
HDT2727A,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG +17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1040.00,1455.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2727B,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG +19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1075.00,1495.00,35.00,0,,HEWLETT-PACKARD,Computer Systems
HDT2727C,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG+19"Wide Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,1065.00,1475.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2727D,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG+20"Wide Microtower Vista Business with XPPro Downgrade Plus L2045w 20" Wide LCD Monitor ,1115.00,1560.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2727,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade ,999.00,1085.00,,0,03.02.2009,HEWLETT-PACKARD,Computer Systems
HDT2724A,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1178.00,1655.00,63.00,144,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2724B,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1201.00,1695.00,,144,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2724C,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+19"W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers ,1199.00,1675.00,-2.00,0,,HEWLETT-PACKARD,Computer Systems
HDT2724D,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+20"W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor ,1260.00,1760.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2724,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade ,1120.00,1285.00,,144,,HEWLETT-PACKARD,Computer Systems';
 
// SIMULATE READING A CSV FILE INTO AN ARRAY OF RECORDS
$data = explode("\n", $testdata);
 
// SEE IF THE DATA HAS THE RIGHT NUMBER OF FIELDS
// foreach ($data as $d)
// {
//    $arr = explode(',', $d);
//    echo "<br/>" . count($arr);
// }
// YES, IT DOES
 
// HERE IS INPUT FORMAT
// model | partno | products_name | buy_price | rrp | | quantity | | vendor | product_type
 
// HERE IS OUTPUT FORMAT
// model | partno | products_name | buy_price | rrp | | quantity | | vendor | product_type | category
 
// ITERATOR
$out = array();
foreach ($data as $d)
{
// TURN CSV INTO AN ARRAY
   $arr = explode(',', $d);
// ELIMINATE EMPTY ARRAY ELEMENTS
   foreach ($arr as $key => $value)
   {
      if (empty($value)) unset($arr[$key]);
   }
// IF ARRAY HAS ONLY ONE THING, TREAT IT LIKE A CATEGORY
   if (count($arr) == 1)
   {
      $category = $arr[0];
      continue; // ELIMINATE THE CATEGORY LINES FROM THE O/P
   }
   $d .= ',' . $category;
   $out[] = $d;
}
 
// VISUALIZE THE DATA
echo "<pre>";
var_dump($out);

Open in new window

The first row is ignored, because it has no following rows with actual data before a new category row. I assume your mysql table has the same layout as the csv, except it has a category column in the end.

After replacing " with &quot; in the input file, the following code seems to work. It inserts all rows in a single statement at the end, if there are very many rows in the input you should insert each row within the loop instead.

The mysql_query() statement is commented out, a echo is used instead so that you can see if it is correct.
<?php 
 
# preparation: replace all occurences of " with &quot;
 
$category = '?'; # read from csv file
$values = array();
$csv_file = fopen('hp.csv','r');
while(!feof($csv_file)) {
  $csv = fgetcsv($csv_file,1000);
  list($model,$partno,$products_name,$buy_price,$rrp,$dummy1,$quantity,$dummy2,$vendor,$product_type) = $csv;
  if($partno=='') {
    $category = $model;
    continue;
  }
  $values[] = "('$model','$partno','$products_name','$buy_price','$rrp','$quantity','$vendor','$product_type','$category')";
}
fclose($csv_file);
echo implode('<br />',$values);
#mysql_query('insert into import_table values '.implode(',',$values));
?>

Open in new window

Line 7 opens the file, my test file is named 'hp.csv', you must change this to whatever your file is named.

Line 9 has a line size limit of 1000, you can remove it: $csv = fgetcsv($csv_file);
After line 10, you could put the " back in by inserting this:
$products_name = str_replace('&quot;','"',$products_name);

Open in new window

Avatar of nwteam

ASKER

@cxr

Ive run your code and the output looks great except the category field is blank leaving only ''. Am i missing something? Is there somthing else i need to change other than the csv file name?
This gives you an array of associative arrays from which to build a query,.  Not sure whether you want to insert or replace into, etc. but the use of the $new array should be pretty clear.

HTH, ~Ray
<?php // RAY_temp_odd_csv.php
 
// TEST DATA
$testdata = 'Computer Systems - Workstations,,,,,,,,,
HEWLETT-PACKARD - Pavilion Series,,,,,,,,,
CPP3660,FK913AA,HP Pavilion S3660a Intel E7300 2GB 360 Vista Prem Intel Core 2 Duo E7300 2.66GHz 2GB 360GB 7200 DVDRW SM DL LS Vista Home Premium ,1155.00,1546.67,,1,,HEWLETT-PACKARD,Computer Systems
CPP6610A,FK971AA,HP Pavilion a6610a Intel E2220 2GB 250 VPrem+22"W Intel Dual Core E2220 2.4GHz 2GB 250GB SuperMulti SATA Drive LS DL Vista Home Premium Plus V220 22" Wide LCD Monitor ,1288.00,1728.57,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6610,FK971AA,HP Pavilion a6610a Intel E2220 2GB 250 Vista Prem Intel Dual Core E2220 2.4GHz 2GB 250GB SuperMulti SATA Drive LS DL Vista Home Premium ,895.00,1200.00,,5,,HEWLETT-PACKARD,Computer Systems
CPP6640A,FK908AA,HP Pavilion a6640a Intel E7300 2GB 500 VPrem+20"W Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200 SuperMulti DVDRW DL LS Vista Home Premium Plus  v220 22" Wide LCD Monitor ,1539.00,2063.81,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6640,FK908AA,HP Pavilion a6640a Intel E7300 2GB 500 Vista Prem Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200 SuperMulti DVDRW DL LS Vista Home Premium ,1145.00,1535.24,,5,,HEWLETT-PACKARD,Computer Systems
CPP6710,FT958AA,HP Pavilion a6710a Intel E2220 2GB 250 Vista Home Intel Dual Core E2220 2.4GHz 2GB 250GB 7200 DVDRW SM DL LS Vista Home Basic ,905.00,1314.29,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6710A,FT958AA,HP Pavilion a6710a Intel E2220 2GB 250 VistaHM+22" Intel Dual Core E2220 2.4GHz 2GB 250GB 7200 DVDRW SM DL LS Vista Home Basic Plus V220 22" Wide LCD Monitor ,1330.00,1885.72,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6730,FT960AA,HP Pavilion a6730a Intel E2220 2GB 320 Vista Home Intel Dual Core E2220 2.4GHz 2GB 320GB 7200 DVDRW SM DL LS Vista Home Premium ,1079.00,1583.49,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6730A,FT960AA,HP Pavilion a6730a Intel E2220 2GB 320 VistaHM+22" Intel Dual Core E2220 2.4GHz 2GB 320GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22" Wide LCD Monitor ,1504.00,2154.92,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6740,FT961AA,HP Pavilion a6740a Intel E7400 2GB 500 Vista Home Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium ,1235.00,1801.90,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6740A,FT961AA,HP Pavilion a6740a Intel E7400 2GB 500 VistaHM+22" Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22" Wide LCD Monitor ,1660.00,2373.33,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP6760,FT962AA,HP Pavilion a6760a Intel E7400 2GB 500 Vista Home Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium ,1349.00,1973.33,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6760A,FT962AA,HP Pavilion a6760a Intel E7400 2GB 500 VistaHM+22" Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22" Wide LCD Monitor ,1774.00,2544.76,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP9590,FT964AA,HP Pavilion m9590a Intel Q9400 8GB 2000 Vista Home Intel Core 2 Quad Q9400 2.66GHz 8GB 2000GB 5400 Blu-Ray DVD Burner SM LS Vista Home Premium 64bit Media Centre PC ,2669.00,4008.89,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP9590A,FT964AA,HP Pavilion m9590a Intel Q9400 8GB 2000 VistaHM+22 Intel Core 2 Quad Q9400 2.66GHz 8GB 2000GB 5400 Blu-Ray DVD Burner SM LS Vista Home Premium 64bit Media Centre PC Plus V220 22" Wide LCD Monitor ,3094.00,4580.32,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP3680A,FK914AA,HP Pavilion s3680a E7300 2GB 500 Blu-ray VP+20"W Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200  Blu-ray SuperMulti DVDRW LS Vista Home Premium Plus v220 22" Wide LCD Monitor ,1725.00,2311.43,,4,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP3680,FK914AA,HP Pavilion s3680a Intel E7300 2GB 500 Blu-ray VP Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200  Blu-ray SuperMulti DVDRW LS Vista Home Premium ,1329.00,1782.86,,4,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - xw4600,,,,,,,,,
CPX4605,KV700EP,HP xw4600 80+ E6850 4GB 250GB DVDROM FX1700 XPP DG Intel Core 2 Duo E6850 4GB 250GB FX1700 DVDROM Vista Business 32bit with XPPro Downgrade  ,2075.00,2350.00,,30,,HEWLETT-PACKARD,Computer Systems
CPX4610,NG992PA,HP xw4600 80+ E8400 2GB 160GB DVDRW FX570 XPP DG Intel Core 2 Duo E8400 2GB 160GB FX570 DVDRW Vista Business 32bit with XPPro Downgrade ,1799.00,2050.00,,16,,HEWLETT-PACKARD,Computer Systems
CPX4609,NG991PA,HP xw4600 80+ E8400 2GB 160GB DVDRW NVS290 XPP DG Intel Core 2 Duo E8400 2GB 160GB NVS290 DVDRW Vista Business 32bit with XPPro Downgrade ,1630.00,1850.00,,92,,HEWLETT-PACKARD,Computer Systems
CPX4611,NG993PA,HP xw4600 80+ Q9550 4GB 160GB DVDRW FX1700 XPP DG Intel Quad Core Q9550 4GB 160GB FX1700 DVDRW Vista Business 32bit with XPPro Downgrade ,2640.00,2995.00,,12,,HEWLETT-PACKARD,Computer Systems
CPX4612,NG994PA,HP xw4600 80+ Q9650 4GB 250GB DVDRW ATI V7700 XPDG Intel Quad Core Q9650 4GB 250GB ATI V7700 512MB Vista Business 32bit with XPPro Downgrade ,3199.00,4150.00,-134.00,16,,HEWLETT-PACKARD,Computer Systems
CPX4614,NK741PC,HP xw4600 E8400 2GB 80 250 FX1700 XP32 AdobePrem 80+ Intel E8400 2GB 80GB+250GB FX1700 DVDRW Vista Business with XPP32 Install Adobe Production Premium CS4 ,3880.00,4395.00,,1,,HEWLETT-PACKARD,Computer Systems
CPX4613,NK743PC,HP xw4600 Q9550 2GB 80 250x2 FX1700 XP64 AdobePrem 80+ Intel Q9550 2GB 80GB+250GB+250GB FX1700 DVDRW Vista Business with XPP64 Install Adobe Production Premium CS4 ,4300.00,4895.00,,1,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - xw6600,,,,,,,,,
CPX6600,FE022AW,HP xw6600 80+ Dual Xeon E5410 4GB 80 DVD NVS290 XP Dual Xeon E5410 4GB 80GB DVDROM NVS290 Vista Business With XPPro 32 Downgrade Microtower ,3575.00,4050.00,,3,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - HP Series - Thin Client,,,,,,,,,
HDT5145A,FL483PA,HP T5145 TCnet 500MHz 128F 512 VESA AUST + 17" LCD Plus L1710 17" LCD Monitor ,670.00,800.00,,77,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5145B,FL483PA,HP T5145 TCnet 500MHz 128F 512 VESA AUST + 19" LCD Plus L1910 19" LCD Monitor ,705.00,850.00,,77,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5145,FL483PA,HP T5145 TCnet 500MHz 128F 512MB ,425.00,480.00,,77,,HEWLETT-PACKARD,Computer Systems
HDT5530,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client ,455.00,515.00,,169,,HEWLETT-PACKARD,Computer Systems
HDT5530D,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+17" Plus L1710 17" LCD Monitor ,690.00,835.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530C,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+19" Plus L1910 19" LCD Monitor ,735.00,885.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530F,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+19"W Plus L1908wm 19" Wide   ,720.00,885.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530G,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+20"W Plus L2045W 20" Wide LCD Monitor ,770.00,815.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540A,FL484PA,HP t5540 CE 1GHz 128F/512R (VESA) TC + 17" LCD Plus L1710 17" LCD Monitor ,740.00,900.00,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540B,FL484PA,HP t5540 CE 1GHz 128F/512R (VESA) TC + 19" LCD Plus L1910 19" LCD Monitor ,775.00,950.00,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client ,510.00,580.00,,286,,HEWLETT-PACKARD,Computer Systems
HDT5540C,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client+19"Wide Plus HP L1908wm 19" Wide LCD Monitor with Speakers ,745.00,950.00,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540D,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client+20"Wide Plus HP L2045W 20" Wide TFT Display LCD Monitor DVI Carbonite black and silver (two-tone) Monitor Doesn\'t ship with DVI Cable ,805.00,1005.00,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545A,FL481PA,HP t5545 1GHz 512F/512R (VESA) Linux +17" LCD Plus L1710 17" LCD Monitor ,750.00,885.00,,46,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545,FL481PA,HP t5545 Linux 512F/512R Thin Client ,500.00,565.00,,46,,HEWLETT-PACKARD,Computer Systems
HDT5630,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC ,590.00,670.00,,19,,HEWLETT-PACKARD,Computer Systems
HDT5630A,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC AUST + 17" LCD Plus L1710 17" LCD Monitor ,863.00,1010.00,,19,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5630B,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC AUST + 19" LCD Plus L1910 19" LCD Monitor ,895.00,1060.00,,19,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5730,KD219AA,HP t5730 S2100 1GB 512MB Thin Client XPE ,665.00,750.00,,102,,HEWLETT-PACKARD,Computer Systems
HDT5730A,KD219AA,HP t5730 S2100 1GB 512MB Thin Client XPE +17" LCD ,885.00,1070.00,,102,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5730B,KD219AA,HP t5730 S2100 1GB 512MB Thin Client+ 19"LCD XPE ,920.00,1120.00,,102,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731,GY227AA,HP t5730 S2100 1GF/1GR Thin Client ,700.00,795.00,,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731A,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L1710 17"LCD ,970.00,1105.00,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731B,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L1910 19"LCD ,990.00,1155.00,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731C,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L2045w LCD ,1050.00,1205.00,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5732,GY229AA,HP t5730 S2100 1GF/512R wifi Thin Client ,660.00,785.00,,2,,HEWLETT-PACKARD,Computer Systems
HDT5735,GY231AA,HP t5735 S2100 1GB 512MB Thin Client Linux ,570.00,645.00,,5,,HEWLETT-PACKARD,Computer Systems
HDT5735A,GY231AA,HP t5735 S2100 1GB 512MB Thin Client+L1710 17"LCD ,820.00,965.00,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5735B,GY231AA,HP t5735 S2100 1GB 512MB Thin Client+L1910 19"LCD ,850.00,1015.00,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545B,FL481PA,t5545 LNX 1GHz 512F/512R (VESA) AUST + 19" LCD Plus L1910 19" LCD Monitor ,780.00,935.00,,46,23.01.2009,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx7400 Value Series - Micro Tower,,,,,,,,,
HDT7422A,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor   ,1340.00,1800.00,,250,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422B,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor   ,1375.00,1840.00,35.00,249,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422C,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+19"W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers   ,1355.00,1820.00,,250,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422D,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+20"W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor   ,1415.00,1905.00,60.00,183,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade   ,1250.00,1430.00,,249,,HEWLETT-PACKARD,Computer Systems
HDT7424,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW GF8400DH XPP DG GF8400DH Microtower Vista Business with XPPro Downgrade  ,1675.00,1830.00,506.00,0,03.02.2009,HEWLETT-PACKARD,Computer Systems
HDT7424A,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+17"LCD GF8400DH Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor   ,1640.00,2200.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT7424B,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+19"LCD GF8400DH Microtower Vista Business with XPPro Downgrade HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro   ,1670.00,2240.00,30.00,0,,HEWLETT-PACKARD,Computer Systems
HDT7424C,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+19"W GF8400DH Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers ,1655.00,2220.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT7424D,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+20"W GF8400DH Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor   ,1710.00,2305.00,55.00,0,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx7400 Value Series - Small Form Factor,,,,,,,,,
HDT7423C,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPP DG+19"W Small Form Factor Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers ,1355.00,1820.00,,261,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7423,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPP Downgrade Small Form Factor Vista Business with XPPro Downgrade  ,1250.00,1430.00,,261,,HEWLETT-PACKARD,Computer Systems
HDT7423A,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPPro DG+17" Small Form Factor Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor   ,1340.00,1800.00,,261,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7423B,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPPro DG+19" Small Form Factor Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor   ,1375.00,1840.00,35.00,261,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7423D,FX987PA,HP dx7400 SFF E8400 2GB 160GB DVDRW XPPro DG+20"W Small Form Factor Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor   ,1415.00,1905.00,60.00,184,23.01.2009,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx2355 AMD Series,,,,,,,,,
HDT1122,FH291PA,HP dx2355 MT AMD LE-1300 80GB 1GB DVD Vista Home AMD Sempron LE-1300 80GB 1GB DVDROM Vista Home Basic  3 Year ONSITE NBD Warranty ONLY WHILE STOCKS LAST ,480.00,555.00,-19.00,10,,HEWLETT-PACKARD,Computer Systems
HDT2359,KY419PA,HP dx2355 MT Ath 5200B 160GB 1GB DVDRW Vista Bus Microtower Vista Business Vista Business plus XPPro Recovery Media in Box ,790.00,920.00,-35.00,1,,HEWLETT-PACKARD,Computer Systems
HDT2362A,FX890PA,HP dx2355 MT Ath 5200B 1GB 160 DVDRW XPP DG+17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1145.00,1450.00,-5.00,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362B,FX890PA,HP dx2355 MT Ath 5200B 1GB 160 DVDRW XPP DG+19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1180.00,1490.00,,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362C,FX890PA,HP dx2355 MT Ath 5200B 1GB 160GB DVDRW XPP DG+19"W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,1160.00,1470.00,-20.00,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362D,FX890PA,HP dx2355 MT Ath 5200B 1GB 160GB DVDRW XPP DG+20"W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor ,1215.00,1555.00,,145,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2362,FX890PA,HP dx2355 MT Ath 5200B 1GB 160GB DVDRW XPPro DG Microtower Vista Business with XPPro Downgrade ,940.00,1080.00,,145,,HEWLETT-PACKARD,Computer Systems
HDT2357,FH209PA,HP dx2355 MT Phenom 8600 160GB 2GB DVDRW XPPro DG Microtower Vista Business Downgrade to XPPro ,920.00,1075.00,-50.00,2,,HEWLETT-PACKARD,Computer Systems
HDT2363C,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBaisc+19W Microtower Vista Basic Plus L1908wm 19" Wide LCD Monitor ,955.00,1245.00,-20.00,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363A,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBasic+17" Microtower Vista Basic Plus L1710 17" LCD Monitor ,940.00,1225.00,-320.00,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363B,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBasic+19" Microtower Vista Basic Plus L1910 19" LCD Monitor ,975.00,1265.00,,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363D,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW VBasic+20W Microtower Vista Basic Plus L2045W 20" Wide LCD Monitor ,1015.00,1330.00,,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361A,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+17" Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1075.00,1360.00,60.00,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361B,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+19" Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1110.00,1400.00,,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361C,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+19W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,1090.00,1380.00,-20.00,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2361D,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160 DVDRW XPP DG+20W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor ,1150.00,1465.00,,150,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2363,FX894PA,HP dx2355 MT Semp LE-1300 1GB 160GB DVDRW VBasic Microtower Vista Basic ,675.00,855.00,,10,,HEWLETT-PACKARD,Computer Systems
HDT2361,FX888PA,HP dx2355 MT Semp LE-1300 1GB 160GB DVDRW XPPro DG Microtower Vista Business with XPPro Downgrade ,865.00,990.00,,150,,HEWLETT-PACKARD,Computer Systems
HDT2355C,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XP DG+19W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,945.00,1155.00,,11,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355D,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XP DG+20W Microtower Vista Business with XPPro Downgrade Plus L2045w 20" Wide LCD Monitor ,995.00,1225.00,,10,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355A,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XPP DG+17 Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,930.00,1125.00,,11,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355B,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XPP DG+19 Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,970.00,1175.00,,8,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2355,FH075PA,HP dx2355 MT Semp LE-1300 80GB 1GB DVDRW XPPro DG Microtower Vista Business with XPPro Downgrade ,715.00,795.00,,10,,HEWLETT-PACKARD,Computer Systems
HEWLETT-PACKARD - dx2710 Series - Micro Tower,,,,,,,,,
HDT2727A,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG +17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1040.00,1455.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2727B,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG +19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1075.00,1495.00,35.00,0,,HEWLETT-PACKARD,Computer Systems
HDT2727C,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG+19"Wide Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor ,1065.00,1475.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2727D,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPP DG+20"Wide Microtower Vista Business with XPPro Downgrade Plus L2045w 20" Wide LCD Monitor ,1115.00,1560.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2727,NA248PA,HP dx2710 MT E1400 1GB 80GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade ,999.00,1085.00,,0,03.02.2009,HEWLETT-PACKARD,Computer Systems
HDT2724A,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+17"LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17" LCD Monitor ,1178.00,1655.00,63.00,144,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2724B,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+19"LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19" LCD Monitor ,1201.00,1695.00,,144,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT2724C,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+19"W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19" Wide LCD Monitor with speakers ,1199.00,1675.00,-2.00,0,,HEWLETT-PACKARD,Computer Systems
HDT2724D,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro DG+20"W Microtower Vista Business with XPPro Downgrade Plus L2045W 20" Wide LCD Monitor ,1260.00,1760.00,,0,,HEWLETT-PACKARD,Computer Systems
HDT2724,FX918PA,HP dx2710 MT E7300 1GB 160GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade ,1120.00,1285.00,,144,,HEWLETT-PACKARD,Computer Systems';
 
// SIMULATE READING A CSV FILE INTO AN ARRAY OF RECORDS
$data = explode("\n", $testdata);
 
// SEE IF THE DATA HAS THE RIGHT NUMBER OF FIELDS
// foreach ($data as $d)
// {
//    $arr = explode(',', $d);
//    echo "<br/>" . count($arr);
// }
// YES, IT DOES
 
// HERE IS INPUT FORMAT
// model | partno | products_name | buy_price | rrp | | quantity | | vendor | product_type
 
// HERE IS OUTPUT FORMAT
// model | partno | products_name | buy_price | rrp | | quantity | | vendor | product_type | category
 
// ITERATOR
$out = array();
foreach ($data as $d)
{
// TURN CSV INTO AN ARRAY
   $arr = explode(',', $d);
// ELIMINATE EMPTY ARRAY ELEMENTS
   foreach ($arr as $key => $value)
   {
      if (empty($value)) unset($arr[$key]);
   }
// IF ARRAY HAS ONLY ONE THING, TREAT IT LIKE A CATEGORY
   if (count($arr) == 1)
   {
      $category = $arr[0];
      continue; // ELIMINATE THE CATEGORY LINES FROM THE O/P
   }
   $d .= ',' . $category;
   $out[] = $d;
}
 
// MAKE AN ARRAY OF ASSOCIATIVE ARRAYS
$new = array();
$tmp = array();
foreach ($out as $key => $d)
{
   $arr = explode(',', $d);
   $tmp["model"]         = $arr[0];
   $tmp["partno"]        = $arr[1];
   $tmp["products_name"] = $arr[2];
   $tmp["buy_price"]     = $arr[3];
   $tmp["rrp"]           = $arr[4];
// $tmp["XXX"]           = $arr[5];
   $tmp["quantity"]      = $arr[6];
// $tmp["XXX"]           = $arr[7];
   $tmp["vendor"]        = $arr[8];
   $tmp["product_type"]  = $arr[9];
   $tmp["category"]      = $arr[10];
 
   $new[] = $tmp;
}
 
// VISUALIZE THE DATA
echo "<pre>";
var_dump($new);

Open in new window

Avatar of nwteam

ASKER

I have a import tool already that imports it all in the db then i run another action to import correctly into oscommerce. But before i do that second action the categories need to be set correctly.

This is just some more information for you guys.
So all you need for output is a clean CSV?  That would go into the import tool, right?
>> the category field is blank leaving only ''

That was strange, it works for me... can you post your test code?
Avatar of nwteam

ASKER

1. I import the feed from my supplier into my db (import code is below)
2. Once its into the suppilers table i need the correct category to be placed into the category column for each correct product.
3. Then i run a action that imports the data from the suppilers table into the correct corresponding tables in osc.

So what i need in a piece of code taht will run through the data chose the $model from each row where $partno = null then save that as a variable or array (this is were i get lost) and update it into $category for the correct products under that category.

ok i got lost there hope taht makes sense.
<?php
/********************************/
/* Edit the entries below to reflect the appropriate values
/********************************/
$databasehost = "localhost";
$databasename = "test";
$databasetable = "sample";
$databaseusername ="test";
$databasepassword = "";
$fieldseparator = ",";
$lineseparator = "\n";
$csvfile = "filename.csv";
/********************************/
/* Would you like to add an ampty field at the beginning of these records?
/* This is useful if you have a table with the first field being an auto_increment integer
/* and the csv file does not have such as empty field before the records.
/* Set 1 for yes and 0 for no. ATTENTION: don't set to 1 if you are not sure.
/* This can dump data in the wrong fields if this extra field does not exist in the table
/********************************/
$addauto = 0;
/********************************/
/* Would you like to save the mysql queries in a file? If yes set $save to 1.
/* Permission on the file should be set to 777. Either upload a sample file through ftp and
/* change the permissions, or execute at the prompt: touch output.sql && chmod 777 output.sql
/********************************/
$save = 1;
$outputfile = "output.sql";
/********************************/
 
 
if(!file_exists($csvfile)) {
	echo "File not found. Make sure you specified the correct path.\n";
	exit;
}
 
$file = fopen($csvfile,"r");
 
if(!$file) {
	echo "Error opening data file.\n";
	exit;
}
 
$size = filesize($csvfile);
 
if(!$size) {
	echo "File is empty.\n";
	exit;
}
 
$csvcontent = fread($file,$size);
 
fclose($file);
 
$con = @mysql_connect($databasehost,$databaseusername,$databasepassword) or die(mysql_error());
@mysql_select_db($databasename) or die(mysql_error());
 
$lines = 0;
$queries = "";
$linearray = array();
 
foreach(split($lineseparator,$csvcontent) as $line) {
 
	$lines++;
 
	$line = trim($line," \t");
	
	$line = str_replace("\r","",$line);
	
	/************************************
	This line escapes the special character. remove it if entries are already escaped in the csv file
	************************************/
	$line = str_replace("'","\'",$line);
	/*************************************/
	
	$linearray = explode($fieldseparator,$line);
	
	$linemysql = implode("','",$linearray);
	
	if($addauto)
		$query = "insert into $databasetable values('','$linemysql');";
	else
		$query = "insert into $databasetable values('$linemysql');";
	
	$queries .= $query . "\n";
 
	@mysql_query($query);
}
 
@mysql_close($con);
 
if($save) {
	
	if(!is_writable($outputfile)) {
		echo "File is not writable, check permissions.\n";
	}
	
	else {
		$file2 = fopen($outputfile,"w");
		
		if(!$file2) {
			echo "Error writing to the output file.\n";
		}
		else {
			fwrite($file2,$queries);
			fclose($file2);
		}
	}
	
}
 
echo "Found a total of $lines records in this csv file.\n";
 
 
?>

Open in new window

Avatar of nwteam

ASKER

@ cxr



<?php
 
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("adv_load_test", $con);
 
# preparation: replace all occurences of " with &quot;
 
$category = '?'; # read from csv file
$values = array();
$csv_file = fopen('757.CSV','r');
while(!feof($csv_file)) {
  $csv = fgetcsv($csv_file,1000);
  list($model,$partno,$products_name,$buy_price,$rrp,$dummy1,$quantity,$dummy2,$vendor,$product_type) = $csv;
  if($partno=='') {
    $category = $model;
    continue;
  }
  $values[] = "('$model','$partno','$products_name','$buy_price','$rrp','$quantity','$vendor','$product_type','$category')";
}
fclose($csv_file);
echo implode('<br />',$values);
#mysql_query('insert into import_table values '.implode(',',$values));
?>

Open in new window

After line 75, add this:

if(trim($linearray[1]) == '') {
  $category = trim($linearray[0]);
  continue;
}
$linearray[] = $category;

You only want to do this for files from this particular supplier, so you need a way to turn it on/off. I suggest something like this:

if($category_on_separate_line) {
  if(trim($linearray[1]) == '') {
    $category = trim($linearray[0]);
    continue;
  }
  $linearray[] = $category;
}

...and initialize it at the start of the script, along with the other configuration settings:

$category_on_separate_line = true;  # true or false
@nwteam: looking at that last code snippet above, you might want to consider cleaning up the CSV before inserting things into the data base.  It looks to me like the strategy of inserting things, then updating to add the category might get a bit brittle.  Any errors from the original CSV might be easier to catch if you tidy the input before you go to the data base.  Just a thought, ~Ray
I can't see the problem that would lead to an empty $category field, but it is probably a better solution to implement this in your existing import script, ref. my previous post.
Ray, the way I understand it, this goes into the database in two steps: first into a temporary import table, then into the "real" table in oscommerce. There are probably relevant checks implemented in this last step.
Avatar of nwteam

ASKER

@cxr

I have multiple import tools for each supplier so the if category_on_seperate_line = true is not need but thanks.

But just to confirm i put:

f(trim($linearray[1]) == '') {
  $category = trim($linearray[0]);
  continue;
}
$linearray[] = $category;

in my import tool?
Yes, I think that is correct, between line 75 and line 77. It checks if the second field is blank, and if so, the first field is set as the category name, and the current line is skipped (continue;). $linearray[] = $category; appends the category at the end of the "normal" product lines.
Avatar of nwteam

ASKER

Unfortunately if I add those lines in at #75 it doesnt import.
Do you mean the php does not run, or it runs but does not do anything?

Did wou write if(... and not f(...

Do you get an error message?
Avatar of nwteam

ASKER

it removes all the lines where partno = null
Avatar of nwteam

ASKER

Sorry when i put the snippet in line 75 the code runs but no errors and nothing is imported in the db, if i do it at line 78 the code runs and it imports but removed all rows where partno = null
Avatar of nwteam

ASKER

Here is my code where it imports but deleted rows where partno = null
if(!file_exists($csvfile)) {
	echo "File not found. Make sure you specified the correct path.\n";
	exit;
}
 
$file = fopen($csvfile,"r");
 
if(!$file) {
	echo "Error opening data file.\n";
	exit;
}
 
$size = filesize($csvfile);
 
if(!$size) {
	echo "File is empty.\n";
	exit;
}
 
$csvcontent = fread($file,$size);
 
fclose($file);
 
$con = @mysql_connect($databasehost,$databaseusername,$databasepassword) or die(mysql_error());
@mysql_select_db($databasename) or die(mysql_error());
 
$lines = 0;
$queries = "";
$linearray = array();
 
foreach(split($lineseparator,$csvcontent) as $line) {
 
	$lines++;
 
	$line = trim($line," \t");
	
	$line = str_replace("\r","",$line);
		
	/************************************
	This line escapes the special character. remove it if entries are already escaped in the csv file
	************************************/
	$line = str_replace("'","\'",$line);
	/*************************************/
	/************************************
	This line escapes the special character. remove it if entries are already escaped in the csv file
	************************************/
	$line = str_replace('"','',$line);
	/*************************************/
	
	$linearray = explode($fieldseparator,$line);
	
	$linemysql = implode("','",$linearray);	
		
	if(trim($linearray[1]) == '') {
  	$category = trim($linearray[0]);
  	continue;
	}
	$linearray[] = $category;
	
	if($addauto)
		$query = "insert into $databasetable values('','$linemysql','$category')"; //or $query = "insert into $databasetable values('','$linemysql','')";
	else
		$query = "insert into $databasetable values('$linemysql')";
	
	$queries .= $query . "\n";
 
	@mysql_query($query);
 
}
 
@mysql_close($con);
 
if($save) {
	
	if(!is_writable($outputfile)) {
		echo "File is not writable, check permissions.\n";
	}
	
	else {
		$file2 = fopen($outputfile,"w");
		
		if(!$file2) {
			echo "Error writing to the output file.\n";
		}
		else {
			fwrite($file2,$queries);
			fclose($file2);
			}
		}
		//$messageStack->add(sprintf(SYNNEX_IMPORT_SUCCESS, $lines), 'success');
		
}

Open in new window

There was no rows with partno=NULL in the data you posted  ... are you using a different data file now?

Is there any column that is allways not null... this if-statement:

if(trim($linearray[1]) == '')

...tests if partno is blank, and assumes that it is a "category-line". There must be some column (other than the first) that is never blank for this to work, or a set of columns.

The code must be put between these two lines (50 and 52 in the latest snippet):

      $linearray = explode($fieldseparator,$line);
      
      $linemysql = implode("','",$linearray);      

This is where $linearray is created, and the sql statement is prepared.
Avatar of nwteam

ASKER

Sorry i should say '' not null.

so statement

      if(trim($linearray[1]) == '') {
        $category = trim($linearray[0]);
        continue;
      }
      $linearray[] = $category;

is basically saying if column 1 (starts at 0) is empty then set column 0 as $category?

So then i should put $category where the category column is on the insert query
insert into $databasetabletechpac values('','$linemysql','$category')?
>> if column 1 (starts at 0) is empty then set column 0 as $category?

Yes.

This line:

 $linearray[] = $category;

... adds the category to the end of the $linearray, which is a list of all columns. Then this line:

$linemysql = implode("','",$linearray);

...glues it all together with apostrophes and commas between each column. You could do like you suggest instead of appending it to $linearray, but don't do both!

I need to sleep now, but will check back tomorrow.
Avatar of nwteam

ASKER

Good morning (well in my part of the world), sorry had a long weekend here so was unable to comment on friday.

It seems to be working but sorry ive run into a problem there is now (supplier changed the feed we get slightly) a carriage return straight after the category row and blank fields in that row. So when it calls the category it uses the blank ones? So im guessing it needs to ignore the row where all fields equal ''. Once this is done i believe it will be working. Hopefully i havnt left it to late for you cxr. Thank you for your time also very much appreciated. Ive attached the new data.
Computer Systems - Workstations,,,,,,,,,
,,,,,,,,,
HEWLETT-PACKARD - Pavilion Series,,,,,,,,,
,,,,,,,,,
CPP3660,FK913AA,HP Pavilion S3660a Intel E7300 2GB 360 Vista Prem Intel Core 2 Duo E7300 2.66GHz 2GB 360GB 7200 DVDRW SM DL LS Vista Home Premium ,1155,1546.67,,1,,HEWLETT-PACKARD,Computer Systems
CPP6610A,FK971AA,"HP Pavilion a6610a Intel E2220 2GB 250 VPrem+22""W Intel Dual Core E2220 2.4GHz 2GB 250GB SuperMulti SATA Drive LS DL Vista Home Premium Plus V220 22"" Wide LCD Monitor ",1288,1728.57,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6610,FK971AA,HP Pavilion a6610a Intel E2220 2GB 250 Vista Prem Intel Dual Core E2220 2.4GHz 2GB 250GB SuperMulti SATA Drive LS DL Vista Home Premium ,895,1200,,5,,HEWLETT-PACKARD,Computer Systems
CPP6640A,FK908AA,"HP Pavilion a6640a Intel E7300 2GB 500 VPrem+20""W Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200 SuperMulti DVDRW DL LS Vista Home Premium Plus  v220 22"" Wide LCD Monitor ",1539,2063.81,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6640,FK908AA,HP Pavilion a6640a Intel E7300 2GB 500 Vista Prem Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200 SuperMulti DVDRW DL LS Vista Home Premium ,1145,1535.24,,5,,HEWLETT-PACKARD,Computer Systems
CPP6710,FT958AA,HP Pavilion a6710a Intel E2220 2GB 250 Vista Home Intel Dual Core E2220 2.4GHz 2GB 250GB 7200 DVDRW SM DL LS Vista Home Basic ,905,1314.29,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6710A,FT958AA,"HP Pavilion a6710a Intel E2220 2GB 250 VistaHM+22"" Intel Dual Core E2220 2.4GHz 2GB 250GB 7200 DVDRW SM DL LS Vista Home Basic Plus V220 22"" Wide LCD Monitor ",1330,1885.72,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6730,FT960AA,HP Pavilion a6730a Intel E2220 2GB 320 Vista Home Intel Dual Core E2220 2.4GHz 2GB 320GB 7200 DVDRW SM DL LS Vista Home Premium ,1079,1583.49,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6730A,FT960AA,"HP Pavilion a6730a Intel E2220 2GB 320 VistaHM+22"" Intel Dual Core E2220 2.4GHz 2GB 320GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22"" Wide LCD Monitor ",1504,2154.92,NEW,0,20.02.2009,HEWLETT-PACKARD,Computer Systems
CPP6740,FT961AA,HP Pavilion a6740a Intel E7400 2GB 500 Vista Home Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium ,1235,1801.9,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6740A,FT961AA,"HP Pavilion a6740a Intel E7400 2GB 500 VistaHM+22"" Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22"" Wide LCD Monitor ",1660,2373.33,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP6760,FT962AA,HP Pavilion a6760a Intel E7400 2GB 500 Vista Home Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium ,1349,1973.33,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP6760A,FT962AA,"HP Pavilion a6760a Intel E7400 2GB 500 VistaHM+22"" Intel Core 2 Duo E7400 2.8GHz 2GB 500GB 7200 DVDRW SM DL LS Vista Home Premium Plus V220 22"" Wide LCD Monitor ",1774,2544.76,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP9590,FT964AA,HP Pavilion m9590a Intel Q9400 8GB 2000 Vista Home Intel Core 2 Quad Q9400 2.66GHz 8GB 2000GB 5400 Blu-Ray DVD Burner SM LS Vista Home Premium 64bit Media Centre PC ,2669,4008.89,NEW,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
CPP9590A,FT964AA,"HP Pavilion m9590a Intel Q9400 8GB 2000 VistaHM+22 Intel Core 2 Quad Q9400 2.66GHz 8GB 2000GB 5400 Blu-Ray DVD Burner SM LS Vista Home Premium 64bit Media Centre PC Plus V220 22"" Wide LCD Monitor ",3094,4580.32,NEW,0,,HEWLETT-PACKARD,Computer Systems
CPP3680A,FK914AA,"HP Pavilion s3680a E7300 2GB 500 Blu-ray VP+20""W Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200  Blu-ray SuperMulti DVDRW LS Vista Home Premium Plus v220 22"" Wide LCD Monitor ",1725,2311.43,,4,23.01.2009,HEWLETT-PACKARD,Computer Systems
CPP3680,FK914AA,HP Pavilion s3680a Intel E7300 2GB 500 Blu-ray VP Intel Core 2 Duo E7300 2.66GHz 2GB 500GB 7200  Blu-ray SuperMulti DVDRW LS Vista Home Premium ,1329,1782.86,,4,,HEWLETT-PACKARD,Computer Systems
,,,,,,,,,
HEWLETT-PACKARD - HP Series - xw4600,,,,,,,,,
,,,,,,,,,
CPX4605,KV700EP,HP xw4600 80+ E6850 4GB 250GB DVDROM FX1700 XPP DG Intel Core 2 Duo E6850 4GB 250GB FX1700 DVDROM Vista Business 32bit with XPPro Downgrade  ,2075,2350,,30,,HEWLETT-PACKARD,Computer Systems
CPX4610,NG992PA,HP xw4600 80+ E8400 2GB 160GB DVDRW FX570 XPP DG Intel Core 2 Duo E8400 2GB 160GB FX570 DVDRW Vista Business 32bit with XPPro Downgrade ,1799,2050,,16,,HEWLETT-PACKARD,Computer Systems
CPX4609,NG991PA,HP xw4600 80+ E8400 2GB 160GB DVDRW NVS290 XPP DG Intel Core 2 Duo E8400 2GB 160GB NVS290 DVDRW Vista Business 32bit with XPPro Downgrade ,1630,1850,,92,,HEWLETT-PACKARD,Computer Systems
CPX4611,NG993PA,HP xw4600 80+ Q9550 4GB 160GB DVDRW FX1700 XPP DG Intel Quad Core Q9550 4GB 160GB FX1700 DVDRW Vista Business 32bit with XPPro Downgrade ,2640,2995,,12,,HEWLETT-PACKARD,Computer Systems
CPX4612,NG994PA,HP xw4600 80+ Q9650 4GB 250GB DVDRW ATI V7700 XPDG Intel Quad Core Q9650 4GB 250GB ATI V7700 512MB Vista Business 32bit with XPPro Downgrade ,3199,4150,-134,16,,HEWLETT-PACKARD,Computer Systems
CPX4614,NK741PC,HP xw4600 E8400 2GB 80 250 FX1700 XP32 AdobePrem 80+ Intel E8400 2GB 80GB+250GB FX1700 DVDRW Vista Business with XPP32 Install Adobe Production Premium CS4 ,3880,4395,,1,,HEWLETT-PACKARD,Computer Systems
CPX4613,NK743PC,HP xw4600 Q9550 2GB 80 250x2 FX1700 XP64 AdobePrem 80+ Intel Q9550 2GB 80GB+250GB+250GB FX1700 DVDRW Vista Business with XPP64 Install Adobe Production Premium CS4 ,4300,4895,,1,,HEWLETT-PACKARD,Computer Systems
,,,,,,,,,
HEWLETT-PACKARD - HP Series - xw6600,,,,,,,,,
,,,,,,,,,
CPX6600,FE022AW,HP xw6600 80+ Dual Xeon E5410 4GB 80 DVD NVS290 XP Dual Xeon E5410 4GB 80GB DVDROM NVS290 Vista Business With XPPro 32 Downgrade Microtower ,3575,4050,,3,,HEWLETT-PACKARD,Computer Systems
,,,,,,,,,
HEWLETT-PACKARD - HP Series - Thin Client,,,,,,,,,
,,,,,,,,,
HDT5145A,FL483PA,"HP T5145 TCnet 500MHz 128F 512 VESA AUST + 17"" LCD Plus L1710 17"" LCD Monitor ",670,800,,77,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5145B,FL483PA,"HP T5145 TCnet 500MHz 128F 512 VESA AUST + 19"" LCD Plus L1910 19"" LCD Monitor ",705,850,,77,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5145,FL483PA,HP T5145 TCnet 500MHz 128F 512MB ,425,480,,77,,HEWLETT-PACKARD,Computer Systems
HDT5530,RK270AA,HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client ,455,515,,169,,HEWLETT-PACKARD,Computer Systems
HDT5530D,RK270AA,"HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+17"" Plus L1710 17"" LCD Monitor ",690,835,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530C,RK270AA,"HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+19"" Plus L1910 19"" LCD Monitor ",735,885,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530F,RK270AA,"HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+19""W Plus L1908wm 19"" Wide   ",720,885,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5530G,RK270AA,"HP T5530 64MB/128MB 800MHz CE 6.0 Thin Client+20""W Plus L2045W 20"" Wide LCD Monitor ",770,815,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540A,FL484PA,"HP t5540 CE 1GHz 128F/512R (VESA) TC + 17"" LCD Plus L1710 17"" LCD Monitor ",740,900,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540B,FL484PA,"HP t5540 CE 1GHz 128F/512R (VESA) TC + 19"" LCD Plus L1910 19"" LCD Monitor ",775,950,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540,FL484PA,HP t5540 CE 6.0 1GHz 128F/512R Thin Client ,510,580,,286,,HEWLETT-PACKARD,Computer Systems
HDT5540C,FL484PA,"HP t5540 CE 6.0 1GHz 128F/512R Thin Client+19""Wide Plus HP L1908wm 19"" Wide LCD Monitor with Speakers ",745,950,,286,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5540D,FL484PA,"HP t5540 CE 6.0 1GHz 128F/512R Thin Client+20""Wide Plus HP L2045W 20"" Wide TFT Display LCD Monitor DVI Carbonite black and silver (two-tone) Monitor Doesn't ship with DVI Cable ",805,1005,,169,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545A,FL481PA,"HP t5545 1GHz 512F/512R (VESA) Linux +17"" LCD Plus L1710 17"" LCD Monitor ",750,885,,46,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545,FL481PA,HP t5545 Linux 512F/512R Thin Client ,500,565,,46,,HEWLETT-PACKARD,Computer Systems
HDT5630,FL480PA,HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC ,590,670,,19,,HEWLETT-PACKARD,Computer Systems
HDT5630A,FL480PA,"HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC AUST + 17"" LCD Plus L1710 17"" LCD Monitor ",863,1010,,19,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5630B,FL480PA,"HP t5630 Xpe 1GHz 1GF/1GR (VESA) TC AUST + 19"" LCD Plus L1910 19"" LCD Monitor ",895,1060,,19,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5730,KD219AA,HP t5730 S2100 1GB 512MB Thin Client XPE ,665,750,,102,,HEWLETT-PACKARD,Computer Systems
HDT5730A,KD219AA,"HP t5730 S2100 1GB 512MB Thin Client XPE +17"" LCD ",885,1070,,102,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5730B,KD219AA,"HP t5730 S2100 1GB 512MB Thin Client+ 19""LCD XPE ",920,1120,,102,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731,GY227AA,HP t5730 S2100 1GF/1GR Thin Client ,700,795,,0,24.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731A,GY227AA,"HP t5730 S2100 1GF/1GR Thin Client+L1710 17""LCD ",970,1105,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731B,GY227AA,"HP t5730 S2100 1GF/1GR Thin Client+L1910 19""LCD ",990,1155,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5731C,GY227AA,HP t5730 S2100 1GF/1GR Thin Client+L2045w LCD ,1050,1205,,1,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5732,GY229AA,HP t5730 S2100 1GF/512R wifi Thin Client ,660,785,,2,,HEWLETT-PACKARD,Computer Systems
HDT5735,GY231AA,HP t5735 S2100 1GB 512MB Thin Client Linux ,570,645,,5,,HEWLETT-PACKARD,Computer Systems
HDT5735A,GY231AA,"HP t5735 S2100 1GB 512MB Thin Client+L1710 17""LCD ",820,965,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5735B,GY231AA,"HP t5735 S2100 1GB 512MB Thin Client+L1910 19""LCD ",850,1015,,5,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT5545B,FL481PA,"t5545 LNX 1GHz 512F/512R (VESA) AUST + 19"" LCD Plus L1910 19"" LCD Monitor ",780,935,,46,23.01.2009,HEWLETT-PACKARD,Computer Systems
,,,,,,,,,
HEWLETT-PACKARD - dx7400 Value Series - Micro Tower,,,,,,,,,
,,,,,,,,,
HDT7422A,FX983PA,"HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+17""LCD Microtower Vista Business with XPPro Downgrade Plus L1710 17"" LCD Monitor   ",1340,1800,,250,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422B,FX983PA,"HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+19""LCD Microtower Vista Business with XPPro Downgrade Plus L1910 19"" LCD Monitor   ",1375,1840,35,249,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422C,FX983PA,"HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+19""W Microtower Vista Business with XPPro Downgrade Plus L1908wm 19"" Wide LCD Monitor with speakers   ",1355,1820,,250,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422D,FX983PA,"HP dx7400 MT E8400 2GB 160GB DVDRW XPPro DG+20""W Microtower Vista Business with XPPro Downgrade Plus L2045W 20"" Wide LCD Monitor   ",1415,1905,60,183,23.01.2009,HEWLETT-PACKARD,Computer Systems
HDT7422,FX983PA,HP dx7400 MT E8400 2GB 160GB DVDRW XPPro Downgrade Microtower Vista Business with XPPro Downgrade   ,1250,1430,,249,,HEWLETT-PACKARD,Computer Systems
HDT7424,FX985PA,HP dx7400 MT Q9400 2GB 250GB DVDRW GF8400DH XPP DG GF8400DH Microtower Vista Business with XPPro Downgrade  ,1675,1830,506,0,03.02.2009,HEWLETT-PACKARD,Computer Systems
HDT7424A,FX985PA,"HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+17""LCD GF8400DH Microtower Vista Business with XPPro Downgrade Plus L1710 17"" LCD Monitor   ",1640,2200,,0,,HEWLETT-PACKARD,Computer Systems
HDT7424B,FX985PA,"HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+19""LCD GF8400DH Microtower Vista Business with XPPro Downgrade HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro   ",1670,2240,30,0,,HEWLETT-PACKARD,Computer Systems
HDT7424C,FX985PA,"HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+19""W GF8400DH Microtower Vista Business with XPPro Downgrade Plus L1908wm 19"" Wide LCD Monitor with speakers ",1655,2220,,0,,HEWLETT-PACKARD,Computer Systems
HDT7424D,FX985PA,"HP dx7400 MT Q9400 2GB 250GB DVDRW XPPro DG+20""W GF8400DH Microtower Vista Business with XPPro Downgrade Plus L2045W 20"" Wide LCD Monitor   ",1710,2305,55,0,,HEWLETT-PACKARD,Computer Systems

Open in new window

Avatar of nwteam

ASKER

Actually ive done it ive modified the code you gave me to work. If you could just comfirm that it is the right way to go about it then we can close this question.
if(trim($linearray[1]) == '' && trim($linearray[0]) != '') {
  	$category = trim($linearray[0]);
  	continue;
	}
	$linearray[] = $category;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nwteam

ASKER

Great thanks it would seem they both work but i will use your last code. Thanks again glad i got this done.
Cheers
Craig