Skip to content

Instantly share code, notes, and snippets.

@erev0s
Created May 17, 2019 22:03
Show Gist options
  • Save erev0s/873b3c878398414e34888b4109023ee9 to your computer and use it in GitHub Desktop.
Save erev0s/873b3c878398414e34888b4109023ee9 to your computer and use it in GitHub Desktop.
extract clean cpu and ram statistics from firebase after copying them manually from the source of the page
#!/bin/bash
sed "s/<tr>//g" < $1 | sed "s/<\/tr>//g" | sed "s/<td>//g" | sed "s/<\/td>//g" | sed '/^[[:space:]]*$/d' | sed "s/<tbody>//g" | sed "s/<\/tbody>//g" | tr -d '[:blank:]' | sed -r '/^.{,3}$/d' | awk -F, 'length($1) < 8 { print f; print} {f=$1}' | sed "s/00://g" | tail -n +3 > tmp
awk 'NR % 2 == 1' tmp > times.txt
awk 'NR % 2 == 0' tmp > values.txt
rm tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment