OpenOffice Calc无法读取简单的CSV文件。为什么? [英] OpenOffice Calc can not read a simple CSV file. Why?

查看:817
本文介绍了OpenOffice Calc无法读取简单的CSV文件。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站(PHP),用于生成包含以下内容的CSV文件(text / csv):

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

当我选择OpenOffice显示CSV文件时,只显示一个空的电子表格。不显示错误。当我尝试用 oocalc test.csv 打开文件时,会发生同样的情况。我尝试了不同版本的OpenOffice。

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.

文件有什么问题?如何从OpenOffice中获取错误消息?

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

更新:
它与使用分号。我已经将文件缩减为4个字符。具有内容 ID; A 的文件将打开CSV导入对话框。但是 ID; E 会打开一个空白表。为什么?

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?

更新2:
模式 id; E 作品。 ID; E 必须是某种魔法代码。是否有人知道这个意思?

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

推荐答案

在文件的前3个字符是SYLK文件的签名。第四个字符可以是P,N或E,它们标记关于如何处理文件其余部分的某些信息...因此,当读取初始签名时,您的CSV文件几乎肯定被解析为SYLK文件,并且文件的其余部分不是有效的SYLK格式。

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.

这篇关于OpenOffice Calc无法读取简单的CSV文件。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆