GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
File Conversions |
20190308 Converting from one file format to another is a common yet complex task. Here we collect together a variety of conversion tasks and the tools to perform them. We use pandoc for much of the hard work. File types supported include docx, md, org, pdf, rst, tex.
$ pandoc mydoc.tex -o mydoc.md # LaTeX to Markdown |
Jupyter notebook conversions are provided by jupyter-nbconvert:
$ jupyter-nbconvert --to markdown doc.ipynd --stdout > doc.md $ jupyter-nbconvert --to python doc.ipynd --stdout > doc.py $ jupyter-nbconvert --to python doc.ipynd --stdout > doc.R |
Another type of conversion results from MS/Windows using a different line ending convention for text files to GNU/Linux (and Unix). Originally dos2unix was used for this task which is now accomplished by flip which will convert the file in-place:
$ flip -u doc.txt # Convert to GNU/Linux format. $ flip -m doc.txt # Convert to MS/Windows format. |