Skip to content

Instantly share code, notes, and snippets.

@Artnoc1
Last active September 20, 2022 11:37
Show Gist options
  • Save Artnoc1/ddf4b1d2dc1b7e2fdf76cd742123521c to your computer and use it in GitHub Desktop.
Save Artnoc1/ddf4b1d2dc1b7e2fdf76cd742123521c to your computer and use it in GitHub Desktop.
H2T, CONVERT ALL HTM AND HTML FILES OF A DIRECTORY TO TEXT
#!/data/data/com.termux/files/usr/bin/bash
#html2text

apt install lynx -y
#---------------------------------------
#FOR HTM
for file in ls *.htm
do
new=basename $file htm
lynx -dump $file > ${new}txt
done
 
#--------------------------------------
#FOR HTML
for file in `ls *.html
do
new=basename $file html
lynx -dump $file > ${new}txt
done
@Artnoc1
Copy link
Author

Artnoc1 commented Jan 29, 2021

#!/data/data/com.termux/files/usr/bin/sh

apt install lynx -y

---------------------------------------

FOR HTM

---------------------------------------

#for file in ls *.htm
#do
#new=basename $file htm
#lynx -dump $file > ${new}txt
#done

--------------------------------------

FOR HTML

---------------------------------------

for file in ls *.html
do
new=basename $file html
lynx -dump $file > ${new}txt
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment