mirror of https://github.com/balkian/bitter.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
|