[THE 1st TIME] Text conversion in a terminal

Forum rules
Share your brain ;)
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

[THE 1st TIME] Text conversion in a terminal

Unread post by machinebacon » Tue Feb 25, 2014 10:10 am

You are stuck in tty and want to read PDFs, edit .doc files or check the content of an .xls file? You can!

PDF
You only need the pdftotext program, get it with

Code: Select all

sudo apt-get install poppler-utils
and then you can already start:

Code: Select all

lesspipe The_Book.pdf
You can convert it to a txt file:

Code: Select all

lesspipe The_Book.pdf > The_Book.txt
which creates the same output file like the short version:

Code: Select all

pdftotext The_Book.pdf
.gz
And lesspipe can also help you read the damned .gz files in /usr/share/doc/, like:

Code: Select all

lesspipe /usr/share/doc/mc/HACKING.gz
.doc
Here you have the choice: catdoc and antiword do the conversion from .doc to ASCII quite perfectly. You can even create a LaTeX file.

Code: Select all

catdoc -a Worksheet.doc #create an ASCII file
catdoc -l Worksheet.doc #create a LaTeX
antiword Worksheet.doc | less # create an ASCII and send it to less
.xls
Again, catdoc can do the conversion, this time to csv:

Code: Select all

xls2csv Spreadsheet1.xls
..gnutella..

Post Reply