echo { "bitrate":1603000 } | xidel.exe - --silent --extract "($json).bitrate
gives
1.603E6
... how can I avoid conversion to obtain '1603000'
Thx in advance
Anonymous
You seem to have CSS turned off. Please don't fill out this field.
XPath notation:
ECHO {"bitrate":1603000} | xidel -se "$json/decimal(bitrate)" ECHO {"bitrate":1603000} | xidel -se "$json/integer(bitrate)" ECHO {"bitrate":1603000} | xidel -se "$json/int(bitrate)" ECHO {"bitrate":1603000} | xidel -se "$json/bitrate cast as decimal" ECHO {"bitrate":1603000} | xidel -se "$json/bitrate cast as integer" ECHO {"bitrate":1603000} | xidel -se "$json/bitrate cast as int"
dot notation, what you're using:
ECHO {"bitrate":1603000} | xidel -se "($json).bitrate cast as decimal" ECHO {"bitrate":1603000} | xidel -se "($json).bitrate cast as integer" ECHO {"bitrate":1603000} | xidel -se "($json).bitrate cast as int" ECHO {"bitrate":1603000} | xidel -se "decimal(($json).bitrate)" ECHO {"bitrate":1603000} | xidel -se "integer(($json).bitrate)" ECHO {"bitrate":1603000} | xidel -se "int(($json).bitrate)"
When you use the functions (decimal(), etc.) in this case, then you have to enclose the entire query. ($json).decimal(bitrate) won't work.
decimal()
($json).decimal(bitrate)
Btw, if you're using one of the latest development builds, then the - (dash for stdin) isn't necessary anymore.
-
Also see: - https://sourceforge.net/p/videlibri/mailman/videlibri-xidel/thread/db8bdc2e-4a17-3640-f040-fc958bc75498%40xs4all.nl/#msg37179400 - https://github.com/qt4cg/qtspecs/issues/33
VERIFIED thx
echo { "bitrate":1603000 } | xidel.exe - --silent --extract
"($json).bitrate
gives
... how can I avoid conversion to obtain '1603000'
Thx in advance
XPath notation:
dot notation, what you're using:
When you use the functions (
decimal()
, etc.) in this case, then you have to enclose the entire query.($json).decimal(bitrate)
won't work.Btw, if you're using one of the latest development builds, then the
-
(dash for stdin) isn't necessary anymore.Also see:
- https://sourceforge.net/p/videlibri/mailman/videlibri-xidel/thread/db8bdc2e-4a17-3640-f040-fc958bc75498%40xs4all.nl/#msg37179400
- https://github.com/qt4cg/qtspecs/issues/33
Last edit: Reino 2022-06-13
VERIFIED
thx