平面文件的节定界

发布于 2024-07-22 07:04:44 字数 107 浏览 5 评论 0原文

我需要生成一个包含几个不同部分的平面文件,每个部分都有不同的记录结构。 所有数据都是分隔文本,每条记录一行。 考虑到记录可以在引用的文本字段中包含换行符等,什么是一个好的定界序列或区分部分的机制?

I need to generate a flat file with several different sections, each with different record structures. All data is delimited text, single line per record. What would be a good delimiting sequence, or mechanism to differentiate sections, given that records can contain line feeds etc. within quoted text fields?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

野心澎湃 2024-07-29 07:04:44

好吧,如果您不需要使用较差的文本编辑器编辑文件,或者文件是人类可读的,您可以使用四个 C0 控制代码之一,它们是 ASCII 字符 28-31,用于分隔文字记录。 由于前两点,他们从未流行起来。

Well, provided you are free of the necessity of editing the file with an inferior text editor or that the file be human-readable, you could use one of the four C0 control codes which are ASCII characters 28–31, which are meant for delimiting text records. They just never caught on because of the first two points.

旧夏天 2024-07-29 07:04:44

您尚未指定您打算如何处理该文件。 您使用什么语言等。

如果文件将包含不同的部分和不同的结构,我建议使用 YAML 结构。

有许多允许使用YAML

You haven't specified what you intend to do with the file. What language do you use, etc.

If the file will contain different sections, and different structures, I would suggest using the YAML structure.

There are many libraries that allow for to reading/writing using YAML.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文