1

I have an XLSX file where there are two different fonts. One cell contains English, while the other contains another language. I would like to save this XLSX file as a CSV file without losing the fonts. Is this possible?

0

3 Answers 3

1

Font choice isn't actually stored when saving as a CSV file, only the data itself. If you're looking to save it exactly as it looks now, fonts and all, you might need to look into using a different format, such as the default of .xls or .xlsx.

Unfortunately, Excel's support for multiple languages when saving isn't very good. I tried saving the following (two columns in Excel)

aeou    aeou
äöüß    äöüß
âêôû    âêôû

as a CSV, and it generated the following:

aeou,aeou
הצ,הצ
גךפ,גךפ

If you're actually trying to simply save some data that contains multiple languages using some form of delimited file, a possible solution is to save it as "Unicode text" instead of CSV. It will generate a tab delimited file (instead of comma) and the file will have an extension of .txt (instead of .csv), but it might be a way around your current issue.

1

Why do you need different fonts for different languages?

CSV stands for comma-separated values. And it really is simply that. It’s text, with values separated by commas (or, in some versions, semi-colons or other delimiters). It’s basically a plain text file, and can be opened and edited with a text editor.

Rich text formats can include meta information, such as which font to use. A plain text file really does contain text and nothing else. The CSV format does not provide any place where font information could be stored.

While a CSV file cannot contain font information, it can, in principle, be in any text encoding1. So, in principle, your CSV file could be saved in a Unicode encoding, such as UTF-8 or UTF-16. In principle, this will work. Unicode encodings cover everything that any other encoding covers. If it’s text, and can be represented on a computer, it can be represented in Unicode. Your CSV editor will decide which font to use, and will probably, if it’s decent, select one that fits. For example, if the file contains characters which the default font doesn’t include, it will automatically use a different font for those characters.

In practice, this will probably work with Libre Office or OpenOffice, but Microsoft Excel isn’t fond of CSV files in encodings other than Latin-1, and doesn’t play nicely with them. This is a failing in Microsoft Office.

Workaround 1: Use Libre Office or OpenOffice.

Workaround 2: Generate a tab-delimited Unicode2 file, as suggested by Matt Champion.


1 Well, any text encoding which includes a comma character. ASCII includes a comma, and the vast majority of other text encodings are supersets of ASCII, but there are one or two encodings out there which don’t include a comma. Binary SignWriting is one example.

2 Unicode is actually a broad family of encodings, rather than one encoding. What Microsoft calls “Unicode” is actually UTF-16 LE, which is one of the Unicode encodings.

0

You can use the macro in this post http://nhatkha.blogspot.com/2016/01/cach-luu-file-excel-sang-file-csv-van.html

The macro convert to UTF8 font. So I think It can solve your case.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .