Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip void elements and specific items values #38

Open
loretoparisi opened this issue May 8, 2017 · 0 comments
Open

Skip void elements and specific items values #38

loretoparisi opened this issue May 8, 2017 · 0 comments

Comments

@loretoparisi
Copy link

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?

@loretoparisi loretoparisi changed the title Skip void elements Skip void elements and specific items values May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant