Skip to content

Instantly share code, notes, and snippets.

@newz2000
Created January 19, 2018 18:57
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 newz2000/48fa41f9da681567064bf50177966819 to your computer and use it in GitHub Desktop.
Save newz2000/48fa41f9da681567064bf50177966819 to your computer and use it in GitHub Desktop.
Create a script from vtt files
#!/bin/bash
for i in *.vtt
do
cat "${i}" | grep -v ' -->' | grep -v -e '^$' > "${i}.txt"
done
for i in *.txt
do
echo "${i}" >> Script.txt
echo >> Script.txt
cat "${i}" >> Script.txt
echo >> Script.txt
done
## Problems:
# • If your script was edited and has line numbers, this doesn't remove them
# • This probably requires your shell to be bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment