Hoy necesité leer un archivo HTML desde consola y encontré esta interesante herramienta.
Más allá de que los archivos HTML son de texto plano, los tags HTML dificultan o entorpecen la lectura del texto. Sin embargo existen algunos navegadores de línea de comandos como w3m que permiten convertir un archivo en formato HTML a texto plano.
En mi caso necesitaba leer un archivo de ayuda README.html
. Para volcar un archivo HTML a salida estándar, se debe utilizar la opción -dump
:
root@debian:/usr/local/src/INFX_GED_11.70.FC9_LINUX_X86_64_M# w3m -dump README.html IBM® Informix® v.11.70 Product CD for Linux Operating Systems ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Table of contents • Products and documentation for Linux • Basic Installation Instructions ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Products and documentation for Linux You can install the following products from the CD on Linux. Software Documentation ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ IBM Informix IBM Informix version Release Notes 11.70 Machine Notes for Linux ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ IBM Informix Client IBM Informix Connect version Installation Products Linux 3.70 Instructions Release Notes ESQL/C Machine Notes C++ Machine Notes ODBC Machine Notes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ IBM Informix JDBC Driver version Release Notes 3.70 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ IBM Informix OpenAdmin version Release Notes Tool (OAT) 3.17.1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ The documentation on this CD has important information you should know before you install: • Release notes provide important information about installation and other issues. They also include links to additional resources. • Machine notes describe platform-specific actions that you must take to configure and use IBM Informix products. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Basic Installation Instructions These instructions cover the recommended installation method. For other installation methods and options, see the IBM Informix Installation Guide for UNIX, Linux, and Mac OS X (Adobe Acrobat Reader recommended). To install Informix and other products and prepare a demonstration server: 1. Create the informix group and informix user. 2. As the root user, run the following command from the directory where the installation media (such as this README file) resides: ids_install -i gui 3. Select the product or products that you want to install. 4. Choose to create a demonstration server. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ IBM Informix, Version 11.70 Copyright © 2010, 2014, IBM. All rights reserved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Se observa que la salida es bastante aceptable, sobre todo considerando que el fuente HTML posee tablas y listas.
En Debian y derivados el navegador w3m es provisto por el paquete w3m
. Para instalarlo simplemente ejecutar: apt-get install w3m
.
Para más información:
man w3m