LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-21-2014, 05:24 PM   #1
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Rep: Reputation: 30
Help me convert this xml file to csv


I want to convert our yahoo store xml feed to csv for easy manipulation.

Here is a sample of the file:

Code:
 <Item ID="7302ss-24s" TableID="item.">
    <ItemField TableFieldID="description" Value=""/>
    <ItemField TableFieldID="option-9-name" Value=""/>
    <ItemField TableFieldID="name" Value="Sterling Silver St. Bede the Venerable Pendant, Stainless Silver Heavy Curb Chain, Large Size Catholic Medal, 1&quot; x 3/4&quot;"/>
    <ItemField TableFieldID="option-7-code" Value=""/>
    <ItemField TableFieldID="download" Value=""/>
    <ItemField TableFieldID="abstract" Value=""/>
    <ItemField TableFieldID="label" Value=""/>
    <ItemField TableFieldID="option-8-name" Value=""/>
    <ItemField TableFieldID="option-6-code" Value=""/>
    <ItemField TableFieldID="orderable" Value="t"/>
    <ItemField TableFieldID="product-url" Value="http://www.catholicfreeshipping.com/7302ss-24s.html"/>
    <ItemField TableFieldID="option-7-price" Value=""/>
    <ItemField TableFieldID="taxable" Value="t"/>
    <ItemField TableFieldID="availability" Value="Usually ships the same business day"/>
    <ItemField TableFieldID="option-5-code" Value=""/>
    <ItemField TableFieldID="option-7-name" Value=""/>
    <ItemField TableFieldID="headline" Value=""/>
    <ItemField TableFieldID="option-4-code" Value=""/>
    <ItemField TableFieldID="option-6-name" Value=""/>
    <ItemField TableFieldID="keywords" Value=""/>
    <ItemField TableFieldID="inset" Value=""/>
    <ItemField TableFieldID="option-2-price" Value=""/>
    <ItemField TableFieldID="option-5-name" Value=""/>
    <ItemField TableFieldID="code" Value="7302SS-24S"/>
    <ItemField TableFieldID="option-3-code" Value=""/>
    <ItemField TableFieldID="option-2-code" Value=""/>
    <ItemField TableFieldID="option-4-name" Value=""/>
    <ItemField TableFieldID="option-9-price" Value=""/>
    <ItemField TableFieldID="code-is-isbn" Value=""/>
    <ItemField TableFieldID="option-3-name" Value=""/>
    <ItemField TableFieldID="option-2-name" Value=""/>
    <ItemField TableFieldID="option-4-price" Value=""/>
    <ItemField TableFieldID="option-10-price" Value=""/>
    <ItemField TableFieldID="icon" Value=""/>
    <ItemField TableFieldID="code-is-upc" Value="t"/>
    <ItemField TableFieldID="caption" Value="Sterling Silver St. Bede the Venerable Pendant, Stainless Silver Heavy Curb Chain, Large Size Catholic Medal, 1&quot; x 3/4&quot; &lt;br&gt;&lt;br&gt;&lt;p&gt;&lt;img border=&quot;0&quot; src=&quot;http://site.catholicfreeshipping.com/blissimg.jpg&quot; width=&quot;600&quot; height=&quot;823&quot;&gt;&lt;/p&gt;Engraving is available for large and medium medals only. &lt;br&gt;Engraving is available up to 4 lines 16 Letters each on the large medals and up to 3 lines 12 Letters each on medium medals. Available Type Fonts: Roman, Helvetica, Script, Mongram, &amp; Monogram Circle. Monogram Fonts are limited to three letters. Add words to be engraved at checkout in comments box.&lt;br&gt;&lt;br&gt;Bliss Manufacturing, a more than 100-year-old, family-owned company, makes all of its jewelry in the U.S.A. They currently offer more than 450 different Patron Saint medals.&lt;br&gt;&lt;br&gt;All Bliss jewelry is die-struck, the same way the U.S. Mint makes coins, which produces rich detail. Each Bliss medal carries a Lifetime Warranty. If for whatever reason a Bliss medal shall become tarnished, Bliss will either re-finish or replace the medal free of charge."/>
    <ItemField TableFieldID="code-is-sku" Value=""/>
    <ItemField TableFieldID="option-6-price" Value=""/>
    <ItemField TableFieldID="condition" Value="New"/>
    <ItemField TableFieldID="sale-price" Value=""/>
    <ItemField TableFieldID="option-8-price" Value=""/>
    <ItemField TableFieldID="option-11-code" Value=""/>
    <ItemField TableFieldID="option-10-code" Value=""/>
    <ItemFieldOptions TableFieldID="options">
      <Option Key="Personalized Engraving">
        <OptionValue Value="No Thank You"/>
        <OptionValue Value="Yes Please Engrave My Medal (+15.00)"/>
      </Option>
    </ItemFieldOptions>
    <ItemField TableFieldID="option-11-name" Value=""/>
    <ItemField TableFieldID="option-3-price" Value=""/>
    <ItemField TableFieldID="option-10-name" Value=""/>
    <ItemField TableFieldID="image" Value="&lt;img border=0 width=406 height=500 src=http://ep.yimg.com/ca/I/catholicfreeshipping_2270_224738098&gt;"/>
    <ItemField TableFieldID="ship-weight" Value=""/>
    <ItemField TableFieldID="page-title" Value=""/>
    <ItemField TableFieldID="gift-certificate" Value=""/>
    <ItemField TableFieldID="option-9-code" Value=""/>
    <ItemField TableFieldID="price" Value="53.5"/>
    <ItemField TableFieldID="option-5-price" Value=""/>
    <ItemField TableFieldID="option-11-price" Value=""/>
    <ItemField TableFieldID="option-8-code" Value=""/>
  </Item>
Any idea of how to use xmlstarlet to get this done?
 
Old 06-21-2014, 06:04 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,384

Rep: Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572
use a spreadsheet
 
Old 06-21-2014, 09:48 PM   #3
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
ok, but what would I do??? How could a "spreadsheet" convert this over to xml?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
convert log file to CSV ablanco20 Linux - Newbie 3 07-23-2013 02:21 PM
LXer: Convert XML to CSV the ugly way using Unix utilities LXer Syndicated Linux News 0 07-21-2012 09:22 PM
Awk xml convert to csv frambau Linux - Newbie 15 02-09-2012 07:44 AM
looking for software to convert multiple csv files to a single xml file Rocket-boy Linux - Software 6 10-28-2009 10:03 AM
Convert into CSV file say_hi_ravi Programming 4 07-17-2008 03:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration