mirror of
https://github.com/balkian/bitter.git
synced 2024-12-22 16:38:13 +00:00
17 lines
350 B
Bash
17 lines
350 B
Bash
|
if [ "$#" -lt 1 ]
|
||
|
then
|
||
|
echo "Usage: $0 <files to convert>"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
QUERY='(.full_text // .retweeted_status.full_text) as $text | [ .id_str,$text ] | @csv'
|
||
|
HEADER='id,text'
|
||
|
|
||
|
for i in "$@"
|
||
|
do
|
||
|
OUTPUT=$i.text.csv
|
||
|
echo $HEADER > $OUTPUT
|
||
|
pv -l -N "$i" $i | jq -r "$QUERY" >> $OUTPUT
|
||
|
# sed -ri s/^"([0-9]+),\\"(.*)\\""$/"\1","\2"/g $OUTPUT
|
||
|
done
|