Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- LYRICS_FILE=$1
- previous_timing=
- previous_text=
- counter=1
- while IFS='' read -r line; do
- if [ -n "$line" ]; then
- timing=`echo "$line" | sed 's/ .*//'`
- text="`echo "$line" | sed 's/^[^ ]* \?//'`"
- if [ -n "$previous_timing" -a -n "$previous_text" ]; then
- echo $counter
- echo "00:$previous_timing --> 00:$timing"
- echo "$previous_text"
- echo
- counter=`expr $counter + 1`
- fi
- previous_timing=$timing
- previous_text="$text"
- fi
- done <$LYRICS_FILE
- if [ -n "$previous_text" ]; then
- echo $counter
- echo "00:$previous_timing --> 00:$timing"
- echo "$previous_text"
- echo
- fi
Add Comment
Please, Sign In to add comment