哪个对象可以容纳大量文本? [英] What object to hold a large amount of text in?

查看:83
本文介绍了哪个对象可以容纳大量文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在计划一个Seaside应用程序来保存文本,单个实例可能高达5Mb.哪种对象最适合呢?

I am planning a Seaside app to hold text, a single instance which may be up to, say, 5Mb. What kind of object is best for this?

我还想对本文进行一些迭代.

I would also like to do some iterations over this text.

谢谢文斯

谢谢您到目前为止的答复.该文件是CSV文件,从旧版财务系统生成文件大约需要40分钟,因此必须预先生成并存储.每条线都是一条客户记录,我需要将每条线拉出并在客户登录时使用这些值.客户访问是不可预测的,并且与传统系统进行交互以动态生成每条线是最后的选择.

Thanks for your replies thus far. The file is a CSV file that takes ~40 minutes to generate from a legacy finance system, so it must be pre-generated and stored. Each line is a customer record and I need to pull each one out and use the values as and when the customer logs in. Customer access is not predictable and interfacing with the legacy system to generate each line on the fly is a very last resort.

推荐答案

鉴于文件生成需要花费很长时间,并且以后您需要或多或少地随机访问文件,因此我选择解析文件然后将结构化数据保存在内存中.

Given that the file takes that long to generate and that you need more-or-less random access to the file later on, I would opt for parsing the file and keeping the structured data in memory afterwards.

您可以使用Squeaksource上的一个CSV Parser项目.它将创建一个可以使用的CSV记录的结构化对象树.

There is a CSV Parser project on Squeaksource that you can use. It will create a structured object tree of the CSV records that you can use.

这篇关于哪个对象可以容纳大量文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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