Convert an XML file to CSV

SellerCloud sends a lot of feeds using XML files and if you want to read one of the files it is easier if you first convert it to CSV so that you can view it in Excel.

Use the attached files XmlToCsv.Executable.zip or download the latest version from http://xmltocsv.codeplex.com/ and then open a DOS prompt and type the following command:

XmlToCsv.Console.exe -xml [TypeXMLFilePathHere] -dir [TypeResultsFolderHere]

For example, an Amazon inventory upload document would be converted from:

<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
    <Header>
        <DocumentVersion>1.01</DocumentVersion>
        <MerchantIdentifier />
    </Header>
    <MessageType>Inventory</MessageType>
    <Message>
        <MessageID>1</MessageID>
        <OperationType>Update</OperationType>
        <Inventory>
            <SKU>ABC</SKU>
            <Quantity>0</Quantity>
            <FulfillmentLatency>1</FulfillmentLatency>
        </Inventory>
    </Message>

to:

SKU        Quantity        FulfillmentLatency    Message_Id
ZZGIPJ            0                    1                            0
ZZDSA            0                    1                            1


ċ
XmlToCsv.Executable.zip
(10k)
Yaakov Borenstein,
Sep 22, 2012, 8:21 PM
Comments