Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

csv

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

like image 524
bnguyen82 Avatar asked Apr 17 '12 10:04

bnguyen82


People also ask

Do CSV files have a size limit?

Answer: The CSV file standards do not seem to have a limit on the number of rows, columns or size but is limited by the program using it and the amount of available memory on the system.

Can CSV hold more than 1 million rows?

CSV files have no limit of rows you can add to them. Excel won't hold more that the 1 million lines of data if you import a CSV file having more lines. Excel will actually ask you whether you want to proceed when importing more than 1 million data rows.

Why is CSV so large?

A CSV file will often be larger than the XLSX it was created from. This is because in XLSX is a actually a compressed (zipped) file - you can unzip it with a standard compression tool and check it out for yourself. You will see smaller XLSX files if there is a lot of repeat data.

What is CSV file format?

A CSV is a comma-separated values file, which allows data to be saved in a tabular format. CSVs look like a garden-variety spreadsheet but with a . csv extension. CSV files can be used with most any spreadsheet program, such as Microsoft Excel or Google Spreadsheets.


2 Answers

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.

like image 79
Peter Lawrey Avatar answered Oct 28 '22 21:10

Peter Lawrey


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.

like image 30
Nanne Avatar answered Oct 28 '22 20:10

Nanne