MS Excel "How to"

Aus Wiki csv4you
Version vom 31. August 2016, 16:12 Uhr von Haemel (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „To import all columns correctly and to prevent automated reformatting by Excel, the entire data area shall be formatted as text: To do this, select the first c…“)
Wechseln zu:Navigation, Suche
Sprachen:
Deutsch • ‎English

Edit UTF-8 encoded CSV files with MS Excel and PSPad

Since UTF-8 has a key role as a global character encoding in the Internet (free according to Wikipedia), will the data from our system, when exporting to a CSV file, correspondingly likewise be UTF-8 encoded. To open such files with the appropriate character set, must be proceeded as follows:

Excel 2003

Menu Selection in Excel

Select on the menu "Data -> Import External Data" the menu item "Import Data".

Excel2003 csv impo 1.png

Select Data Source

It opens the dialog "Select Data Source". Select the file to open and click the "Open" button.

Excel2003 csv impo 2.png

Text Import Wizard - Step 1 of 3

Next set the file origin (character encoding) to UTF-8 (almost at the bottom of the list) and proceed with the button 'Continue'.

Excel2003 csv impo 3.png

Text Import Wizard - Step 2 of 3

In this dialog, set the delimiter to a semicolon instead of tab stop and proceed again with the button 'Continue'.

Excel2003 csv impo 4.png

Text Import Wizard - Step 3 of 3

To import all columns correctly and to prevent automated reformatting by Excel, the entire data area shall be formatted as text: To do this, select the first column, press and hold the Shift key now pressed until you have added the remaining columns to the selection. As a result should the entire data area - as seen in the image - now be marked from left to right and appropriately highlighted black. Afterwards you choose as the data format of the columns the 'Text' option and quit the wizard with the 'Finish' button.

Excel2003 csv impo 5.png

Import Data

Im letzten Schritt gibt es die Möglichkeit auszuwählen, wohin die Daten eingefügt werden sollen. Es empfiehlt sich hier, die Option Neues Arbeitsblatt zu wählen. Mit der Schaltfläche OK beenden Sie die Prozedur und die Daten werden UTF-8 codiert in Microsoft Excel angezeigt.

Excel2003 csv impo 6.png

Allow Calculations

Die Daten werden jetzt als Text angezeigt, es können zunächst keine Berechnungen durchgeführt werden. Ersetzen Sie anschließend alle Punkte (.) durch Komma (,) mit der Schaltfläche Suchen und Auswählen. Dann markieren Sie alle Spalten, die Zahlen enthalten, und formatieren die Zellen. Wählen Sie dazu im Bereich „Zahlen“ die Kategorie Standard aus.

Save File

  • "Speichern unter" -> "CSV (Trennzeichen getrennt) *.csv" auswählen
  • Verzeichnis wählen, evtl. Dateinamen vergeben
  • Speichern
  • Sicherheitsfragen mit "Ja" bzw. "OK" beantworten

Convert back in UTF-8 with PSPad

Since MS Excel saves CSV-files only in Windows ANSI format, we need to convert the file back in the UTF-8 format. Here we use the freely available software PSPad. Other text editors should but also be able to accomplish this.

  • File -> Open
  • Format -> Select UTF-8
  • Save

Excel 2007/2010

Menu Selection in Excel

Wählen Sie über die Karteikarte Daten im Abschnitt Externe Daten abrufen die Option Aus Text aus.

Excel2010 csv impo 1.png

Import Text File

Es öffnet sich der Dialog Textdatei importieren. Wählen Sie hier die zu öffnende Datei aus und betätigen Sie die Öffnen Schaltfläche.

Excel2010 csv impo 2.png

Text Import Wizard - Step 1 of 3

Next set the file origin (character encoding) to UTF-8 (almost at the bottom of the list) and proceed with the button 'Continue'.

Excel2010 csv impo 3.png

Text Import Wizard - Step 2 of 3

In this dialog, set the delimiter to a semicolon instead of tab stop and proceed again with the button 'Continue'.

Excel2010 csv impo 4.png

Text Import Wizard - Step 3 of 3

To import all columns correctly and to prevent automated reformatting by Excel, the entire data area shall be formatted as text: To do this, select the first column, press and hold the Shift key now pressed until you have added the remaining columns to the selection. As a result should the entire data area - as seen in the image - now be marked from left to right and appropriately highlighted black. Afterwards you choose as the data format of the columns the 'Text' option and quit the wizard with the 'Finish' button.

Excel2010 csv impo 5.png

Import Data

In diesem Schritt gibt es die Möglichkeit auszuwählen, wohin die Daten eingefügt werden sollen. Es empfiehlt sich hier, die Option Neues Arbeitsblatt zu wählen. Mit der Schaltfläche OK beenden Sie die Prozedur und die Daten werden UTF-8 codiert in Microsoft Excel angezeigt.

Excel2010 csv impo 6.png

Allow Calculations

Die Daten werden jetzt als Text angezeigt, es können zunächst keine Berechnungen durchgeführt werden. Ersetzen Sie anschließend alle Punkte (.) durch Komma (,) mit der Schaltfläche Suchen und Auswählen im Bereich Bearbeiten. Dann markieren Sie alle Spalten, die Zahlen enthalten, und formatieren die Zellen. Wählen Sie dazu im Bereich „Zahlen“ die Kategorie Standard aus.

Save File

  • "Speichern unter" -> "CSV (Trennzeichen getrennt) *.csv" auswählen
  • Verzeichnis wählen, evtl. Dateinamen vergeben
  • Speichern
  • Sicherheitsfragen mit "Ja" bzw. "OK" beantworten

Convert back in UTF-8 with PSPad

Since MS Excel saves CSV-files only in Windows ANSI format, we need to convert the file back in the UTF-8 format. Here we use the freely available software PSPad. Other text editors should but also be able to accomplish this.

  • File -> Open
  • Format -> Select UTF-8
  • Save