java csv文件中一列的最大长度是多少?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10189190/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 23:59:37  来源:igfitidea点击:

What is the maximum length of a column in csv file?

javacsv

提问by bnguyen82

What is the maximum length of a column in csv file. Is it controllable by java code?

csv文件中一列的最大长度是多少。可以通过java代码控制吗?

回答by Peter Lawrey

You can have a column which is as long as the maximum files size. This is usually limited by the size of hard drive.

您可以拥有一个与最大文件大小一样长的列。这通常受硬盘驱动器大小的限制。

In Java the pratical limit is around 2 billion characters which is the maximum size of a String.

在 Java 中,实际限制是大约 20 亿个字符,这是字符串的最大大小。

You can limit the length if you wish.

如果您愿意,可以限制长度。

回答by Nanne

CSV is a format that says you are separating your values with commas. That's basically it. There is no maximum in that standard.

CSV 是一种格式,表示您用逗号分隔您的值。基本上就是这样。该标准没有最大值。

Your filesystem has a file-size limit, so that stops it, and your code may have a memory problem is you try to read several gigs, but there is no maximum.

您的文件系统有文件大小限制,因此可以阻止它,并且您的代码可能存在内存问题,因为您尝试读取多个演出,但没有最大值。

All possible maximums are defined by other factors, not by it being CSV.

所有可能的最大值都由其他因素定义,而不是 CSV。

回答by Perception

CSV is not a standardized format. There is no prescribed length for any 'column' in the file, nor is there any actual formal requirement for the file apart from a list of values separated by commas.

CSV 不是标准化格式。文件中的任何“列”都没有规定长度,除了以逗号分隔的值列表之外,文件也没有任何实际的正式要求。

回答by TechSpellBound

CSV files don't have a limit on the maximum size except memory constraints.

除内存限制外,CSV 文件对最大大小没有限制。

However, I feel that it would be a very bad architecture using such a big CSV file in your application.

但是,我觉得在您的应用程序中使用如此大的 CSV 文件将是一个非常糟糕的架构。