-
I would like to use the As a very contrived example, if I run:
...then I get...
...whereas I would expect...
I have tried a combination of escaping and so on, but just can't get it to work. Thanks if you can help! 🙂 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You should be able to use E.g. This worked for me: $ echo '{ "filename": "a.txt", "size": "1MB" }
{ "filename": "b.txt", "size": "0.5MB" }
{ "filename": "c.txt", "size": "1.5MB" }
{ "filename": "d.txt", "size": "0.3MB" }' | dasel -r json -w csv 'all().mapOf(file_path,join(/,string(/some/dir),filename),file_size,size).merge()'
file_path,file_size
/some/dir/a.txt,1MB
/some/dir/b.txt,0.5MB
/some/dir/c.txt,1.5MB
/some/dir/d.txt,0.3MB |
Beta Was this translation helpful? Give feedback.
You should be able to use
string()
with no args to represent an empy string, however I wouldn't join with an empty string in this case, rather join with/
.E.g. This worked for me: