convert html file to ascii text; write the converted file to disk

Eon Works | Scripts | Demo | About | Links

img
script: html2txt (download)
purpose: convert html file to ascii text; write the converted file to disk
requires: standard GNU commands, lynx
version: 1.1
usage: html2txt [-vhmlr] <file> [file...]
options:
 

     -r, remove input file after conversion

     -v, verbose

     -h, usage and options (help)

     -m, manual

     -l, see this script"

manual:
 



DESCRIPTION



    html2txt converts ascii files with html content to plain text. It replaces the

    previous suffix, if any, with a "txt" suffix. It skips the following files:



    - binary files

    - directories

    - files that already have the same name as <input_file>.txt



    Option -r, removes the input file after conversion.



EXAMPLES



    Use find with xargs to run the script recursively on multiple files. For

    example, to convert all html files to text recursively:



    find . -name "*.html" | xargs html2txt