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 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题