You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am learning Xidel 0.9.8 on Ubuntu. My issue is that I have looked into the documentation, but as far as I can tell it gives no clue (none I recognize, at least) to do this.
I have a JSON file with records that have, among others, id and title fields, eg:
#> jq '.' test.json | cut -c1-100 | more
[
{
"id": 42,
"title": "Software is eating the world",
I want to extract with Xidel those two values, producing output lines like this:
ARTICLE: 42 ==> Software is eating the world
or at least like this:
42 ==> Software is eating the world
and I can't find, or recognize, the right syntax to use for what seems a general, very common need to me. The closest I have come to what I want is this:
Greetings,
I am learning Xidel 0.9.8 on Ubuntu. My issue is that I have looked into the documentation, but as far as I can tell it gives no clue (none I recognize, at least) to do this.
I have a JSON file with records that have, among others, id and title fields, eg:
I want to extract with Xidel those two values, producing output lines like this:
ARTICLE: 42 ==> Software is eating the world
or at least like this:
42 ==> Software is eating the world
and I can't find, or recognize, the right syntax to use for what seems a general, very common need to me. The closest I have come to what I want is this:
xidel test.json -e 'for $t in $json/title return string-join(("$t/../id", $t), " ==> ")'
which produces lines like these:
$t/../id ==> Software is eating the world
what is the right way to refer to the id value of the current record???
Thanks!
The text was updated successfully, but these errors were encountered: