Skip to content

Instantly share code, notes, and snippets.

@nanpuyue
Last active March 28, 2019 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanpuyue/2c28d41270ec72de3ebb48e0317f1b96 to your computer and use it in GitHub Desktop.
Save nanpuyue/2c28d41270ec72de3ebb48e0317f1b96 to your computer and use it in GitHub Desktop.
#!/bin/bash
# file: export_data.sh
# date: 2019-03-29
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
# note:
# sigrok-cli -i xxx.sr -P uart:baudrate=1500000:tx=D3 -A uart=tx-data --protocol-decoder-samplenum
INTERVAL=100
END=0
while read line; do
LINE=(${line/-/ })
START="${LINE[0]}"
DATA="${LINE[3]}"
if ((START-END > INTERVAL)); then
echo
fi
echo -n "$DATA"
END="${LINE[1]}"
done < "$1"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment