dpxua26604 2009-03-23 04:36
浏览 18
已采纳

是否有一种方法(或最佳实践)来标记CSV文档的头部(等效)?

I am exporting data from a database using PHP to convert it into a CSV. I figured it'd be useful to provide the first row with a title (similar to the <th> element in HTML) so the end user would understand the column's meanings. Example

=============
| id | name |
=============
| 0  | tim  |
| 1  | tom  |
=============

Which would look like this as a CSV

id, name
0, tim
1, tom

Is there a way to mark up the first row's columns or do anything differently that programs that often read CSVs (example Microsoft Excel) will mark it up accordingly. I.e. provide a semantic hook to inform the client (possibly Excel but not restricted to) that this is a column header?

  • 写回答

3条回答 默认 最新

  • dongying3744 2009-03-23 04:38
    关注

    Nope. And to make it even more fun, there's nothing that says that the header line has to be present at all. Good times, good times...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
  • ¥100 H5网页如何调用微信扫一扫功能?
  • ¥15 讲解电路图,付费求解