jq 命令解析報錯

parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 232, column 2

因爲你的json裏有啥不可見的亂七八糟的符號:http://rosettacode.org/wiki/Strip_control_codes_and_extended_characters_from_a_string#jq

cat tmp|awk '{print $9}'|jq -R 'fromjson?|select(type == "object")'|jq '.liveid,.text' > tmp2

用這個jq -R 'fromjson?|select(type == "object")'過濾一下會很nice。

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章