OpenOffice Calc can not read a simple CSV file. Wh

2019-03-01 10:57发布

I have a Web site (PHP) that generates a CSV file (text/csv) with the following content:

ID;E-Mail_User;Name;Applikation;Rolle;Auftragsdatum;Administrator
522;user@domain;WXDUILAS;ABCD;XYZ;2009-03-04 05:00:09;user@domain

When I select OpenOffice to show the CSV file only an empty spread sheet is shown. No error is displayed. When I try to open the file with oocalc test.csv the same happens. I have tried different versions of OpenOffice.

What is wrong with the file? How can I get an error message out of OpenOffice?

Update: It does not have anything to do with the use of semicolons. I have reduced the file to 4 charaters. A file with the contents ID;A opens the CSV import dialog. But a ID;E opens an empty sheet. Why?

Update 2: The pattern id;E also works. ID;E must be some kind of magic code. Does anybody know the meaning?

3条回答
Summer. ? 凉城
2楼-- · 2019-03-01 11:34

CSV means C omma S eparated V alues, which is not what your document contains.

Those are semicolons.

If possible, change the PHP code to generate this instead (which is actually CSV):

ID,E-Mail_User,Name,Applikation,Rolle,Auftragsdatum,Administrator
522,user@domain,WXDUILAS,ABCD,XYZ,2009-03-04 05:00:09,user@domain

...or specify ; as the delimiter using the Text Import dialog.

查看更多
祖国的老花朵
3楼-- · 2019-03-01 11:42

ID; in the first 3 characters of a file is the signature for a SYLK file. The fourth character can be a P, N or an E which flags certain information about how the rest of the file should be processed... so your "CSV" file is almost certainly being parsed as a SYLK file when that initial signature is read, and the remainder of the file is not valid SYLK format.

查看更多
戒情不戒烟
4楼-- · 2019-03-01 11:44

Add space after ID (i.e. "ID ").

Not the perfect solution but worked for me.

查看更多
登录 后发表回答