I will first explain my issue… I have a CSV file that is imported onto my server daily.
I am then wanting to import the contents of the CSV file onto the Magento platform as products however my CSV file is not set up correctly for a Magento import.
So here are the first 2 rows of my CSV:
Feed_Id,Vehicle_ID,FullRegistration,Colour,FuelType,Year,Mileage,Bodytype,Doors,Make,Model,Variant,EngineSize,Price,Transmission,PictureRefs,ServiceHistory,PreviousOwners,Category,FourWheelDrive,Options,Comments,New,Used,Site,Origin,v5,Condition,ExDemo,FranchiseApproved,TradePrice,TradePriceExtra,ServiceHistoryText,Cap_Id,AttentionGrabber
119345,679049,VO10OHS,BLACK,Diesel,2010,77000,Estate,5,AUDI,Q7,3.0 TDI QUATTRO S LINE 5d AUTO 240 BHP 0% FINANCE ,2967,24495,Automatic,"http://static.click247.co.uk/vehicles/679/679049/large1/3672310.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3672315.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3672316.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3672317.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3672313.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3672312.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3672314.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582603.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582604.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3672321.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3672322.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582591.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582592.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582673.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582605.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582593.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582594.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582597.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582606.jpg,http://static.click247.co.uk/vehicles/679/679049/large1/3582598.jpg",Y,0,CARS,Y,"Adjustable Steering Column/Wheel - Rake/, AUDI MUSIC INTERFACE, AUDI PARKING SYSTEM, BLACK STYLING PACK, BOSE SURROUND SOUND, ELECTRIC TAILGATE, HDD-BASED SATELLITE NAVIGATION SYSTEM, MOBILE PHONE PREPARATION, PEARL EFFECT PAINT, PRIVACY GLASS, SMART BEAM, STAINLESS STEEL RUNNING BOARDS, VUSIBILITY PACKAGE, Air Bag Driver, Air Bag Passenger, Air Bag Side - Driver/Passenger, Alarm , Anti-Lock Brakes, Armrest - Front/Rear, Ashtray/Lighter, Bumpers, Central Door Locking - Remote , Centre Console, Centre Rear Seat Belt, Child Locks - Electric, Cigar Lighter, Climate Control, Computer - Driver Information System, Cruise Control, Cup Holder, Electric Windows - Front/Rear, Electronic Brake Force Distribution, Electronic Stability Programme, Front Fog Lights, Head Air Bags - Front/Rear, Head Restraints - Front/Rear, Heated Rear Screen, Immobiliser, In Car Entertainment - Radio/CD, Mirrors External - Electric Heated/Foldi, Mirrors Internal - Auto Dimming Rear Vie, Parking Aid - Rear, Power Sock",Comprehensive RAC parts and labour warranty available on selected vehicles-FINANCE AVAILABLE on selected vehicles-Call 01204 393181 for more details. Please click on the Dealers Website link to view more details and larger photos. REF:KEZW,N,Y,C,UK,Y,,,,0,,Full Dealer,,MEGA SPEC OVER £8000 EXTRAS
It might be best to copy and past the CSV data and save it as a CSV to understand the issue further.
If you look at column 16 you will notice there are a bunch of URL images separated by commas however are inside some quotes.
I would like to take the first URL image inside the quotation marks and put this into an extra column within that row.
I’d like to do this for every row that is in the CSV apart from the first row.
Any idea if this is possible with PHP and if so could you show me an example of how this might be done?
Much Appricated

0 comments:
Post a Comment