Windows DatabaseebooksStatistical Information

LLE10191 : How to convert Windows text files.

Symptom:

--

Cause:

You want ot convert Windows text files so that they are displayed correctly under Ubuntu.

Solution:

Many users want to use their Windows textfiles under Ubuntu but the files aren't correcly displayed. This is because of these text files have no header information unlike Office docs and Linux and Windows are encoding the files in different ways. This is just as well true for HTML files. In a browser the files are displayed correctly because the header information is available but the source files are often saved in ANSI format as plain text files without header information.

Ubuntu offers a simple way of converting the Windows text files in a correct format. Just use the "Recode" command. To install the "recode" packet use the following command:

sudo apt-get install recode

After the packet is installed type "echo $lang" at the command prompt to find out which your current text encrpytion is.
Example: echo $lang
              de_DE.UTF-8

In this example you are using UTF-8 which is widely used. You need this information for the correct recoding of the text files. Now use the recode command to convert the text files:

  recode ms-ansi..UTF-8 test.txt

Hint: If you want to use a filename which contains spaces, set the filename in quotation marks (e.g. "Converted test.txt").


Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!
Copyright © 2004-2011 Lubby (V3.0.10 Aug 2011)
Sponsored by Keskon.
Statistical information by Google Analytics