Last active
March 28, 2019 16:32
-
-
Save nanpuyue/2c28d41270ec72de3ebb48e0317f1b96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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