bnguyen82
bnguyen82

Reputation: 6248

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

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

Upvotes: 10

Views: 27100

Answers (4)

TechSpellBound
TechSpellBound

Reputation: 2555

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

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

Upvotes: 1

Perception
Perception

Reputation: 80623

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.

Upvotes: 3

Nanne
Nanne

Reputation: 64419

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

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.

Upvotes: 3

Peter Lawrey
Peter Lawrey

Reputation: 533660

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.

You can limit the length if you wish.

Upvotes: 13

Related Questions