Posts

Showing posts from October, 2020

Powershell: import complex PRICAT csv file

Image
Background A while ago I was asked to help with importing tyre data from several different manufacturers into a local PIM system. For exchanging data electronically the tyre industry have adopted the EDIFACT subset EANCOM PRICAT for the trade, particularly for the tyre trade by the term "EDIWheel". EDIWheel process begin with an electronic product and price catalogue (PRICAT) then orders (ORDERS), confirmation of orders (ORDRSP), delivery dispatch (DESADV) and electronic invoice (INVOIC). The EDI documents I had to process was PRICAT and invoice. PRICAT is basically a CSV file with some extra information on the first rows of the file. Delimiter in the file was ";". The extra rows in the csv file prevented me from simply reading the file with the built-in powershell function import-csv . EDIWheel PRICAT exists in two different versions, B2 (2008) or B4 (2016). In my case the format will be the older B2 format. Since the only script language available, due to the IT-...