Skip to content

Skip void elements and specific items values #38

@loretoparisi

Description

@loretoparisi

In my xml, I have some nodes in the chosen tag that have no values, I would like to skip them:

A typical node is like this

<source>Yahoo Business</source><url>http://us.rd.yahoo.com/dailynews/rss/business/*http://story.news.yahoo.com/news?tmpl=story2 u=/nm/20040814/bs_nm/column_stocks_week_dc</url><title>Wall St. Pullback Reflects Tech Blowout (Reuters)</title><image>none</image><category>Business</category><description>Reuters - Wall Street's long-playing drama,\"Waiting for Google," is about to reach its final act, but its\stock market debut is ending up as more of a nostalgia event\than the catalyst for a new era.</description><rank>5</rank><pubdate>0000-00-00 00:00:00</pubdate>

and for some of them, I have that the category is "" or it has another value to skip. When I convert to csv doing like

xml2csv --input data/newsspace200.xml --output data/newsspace200_.csv --delimiter $'\t' --tag 'source'

I will get the rows with "" category columni.n the csv file. Is it possibile to skip then those columns?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions