Note that there are some explanatory texts on larger screens.

plurals
  1. POhow should I go about converting xml into csv
    primarykey
    data
    text
    <p>I am trying to take some xml code, a sample being below:</p> <pre><code> &lt;time_report&gt; &lt;project_ID&gt;4&lt;/project_ID&gt; &lt;project_status&gt;close&lt;/project_status&gt; &lt;client_ID&gt;6001&lt;/client_ID&gt; &lt;time_record&gt; &lt;project_start_time&gt;15:02:33&lt;/project_start_time&gt; &lt;project_end_time&gt;15:07:44&lt;/project_end_time&gt; &lt;project_total_time&gt;PT00H05M11S&lt;/project_total_time&gt; &lt;/time_record&gt; &lt;employee_ID&gt;10001&lt;/employee_ID&gt; &lt;employee_name&gt;Mary Beth&lt;/employee_name&gt; &lt;date_created&gt;2009-08-25&lt;/date_created&gt; &lt;/time_report&gt; </code></pre> <p>and then output it so it is in the following format:</p> <pre><code>project_id, project_status, client_id, project_start_time, project_end_time, project_total_time, employee_ID, employee_name, date_created 4, close, 6001, 15:02:33, 15:07:44, PT00H05M11S, 10001, Mary Beth, 2009-08-25 </code></pre> <p>I have been trying to use xmllint to do this, but have unfortunately not been able to make any progress, having said that I was wondering if anyone would have a suggestion as to what I should do? I would be doing this in a bash/shell environment. any help would be much appreciated, thanks!</p> <p>also forgot to mention that I can get the correct results if I open the xml file up in excel and then save as csv, just looking for a way to do it in linux</p> <pre><code> project_ID,project_status,client_ID,project_start_time,project_end_time,project_total_time,employee_ID,employee_name,date_created 4,close,6001,15:02:33,15:07:44,PT00H05M11S,10001,Mary Beth,8/25/2009 5,open,6003,12:00:00,12:45:00,PT00H45M00S,10003,Michelle,9/11/2009 2,close,6002,10:00:00,10:30:00,PT00H30M00S,10002,Joe,8/25/2009 2,open,6004,12:00:00,3:27:05,PT03H23M05S,10004,Mike,8/13/2009 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload