Increase size limit of data import from csv into Excel
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2 Looping
--
Chapters
00:00 Increase Size Limit Of Data Import From Csv Into Excel
00:35 Accepted Answer Score 17
01:43 Answer 2 Score 1
02:33 Answer 3 Score 0
03:07 Answer 4 Score 0
04:21 Answer 5 Score 0
06:04 Thank you
--
Full question
https://superuser.com/questions/542927/i...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#microsoftexcel #microsoftexcel2010 #csv #import
#avk47
ACCEPTED ANSWER
Score 17
There is a weird bug in Excel. I'll explain here how to avoid (not fix, just avoid) it, and maybe it will fixed soon by MS Office programmers. Maybe it even WAS fixed in Excel 2013, I did not open it yet.
So, this is the problem.
The maximum length of the text cell is 32767, and it's OK.
The maximum length of the number cell is 255, and it's OK.
But if you have a cell that calls to number parser, fails and then calls to text parser, here will be the big mess.
For example:
...,"This is a cell with 30,000 characters........",...
will work.
But if you'll put a little minus at the start, as in
...,"-This is a cell with 30,000 characters........",...
you'll see only 255 first text characters, because EXCEL thinks it's a negative number.
Hope it helps.
ANSWER 2
Score 1
I ran into this problem with a csv file that had some long text fields that sometimes began with a dash. It seems that Excel's import tries to process the field as a number because of the dash, and the number import trims it to 255 characters. When that fails, it imports it as text, but only the first 255 characters.
To avoid the problem, I had to import the csv instead of just opening it. In the import wizard, I selected the column that was having trouble and switched its type from General to Text. Then Excel won't even try to parse it as a number, and I get the full column width.
ANSWER 3
Score 0
According to http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP010342495.aspx, Excel 2010 only supports a 255 character column width.
Edit: Is this the problem you're talking about, Webweaver? Does Format > Cells > Wrap Text make the rest of the characters visible?
Edit: Never mind, this answer is somewhat unrelated to the problem at hand (possibly related somehow, but it doesn't answer the question)
ANSWER 4
Score 0
Firstly, Thank you all for your help in trying to solve this. It turns out excel can quite happily accommodate more than 255 chars to a cell (presumable up to 32,767 as previously mentioned if you've got the ram for it.
So why didn't is work?
The short answer is I'm not sure. The first time I brought the data into excel I exported as a csv then opened in excel. This cut the columns short (at 255). (the csv file contained all the data when viewed through notepad but not when saved again through excel).
The column in question did contain some semicolons, but this didnt correspond to the cut off point (always 255) and I wasnt using ; as a delimiter.
My solution wast to do an export as an xls file. This has since been saved successfully as a csv file with the full data.
Hope this helps someone even though I'm still not sure exactly what the issue was here.
ANSWER 5
Score 0
Generally, this is an old limitation that no longer applies to modern versions of Excel (2013 anyway). However, if a workbook was originally created in an older version, cell objects that were modified (i.e. thereby instantiated with particular properties and attributes) in the older version will, apparently, retain the 255 character limitation even when opened in newer versions of Excel!
A fix:
- Using a modern version of Excel, in a different, unused cell on the worksheet, recreate whatever formatting and/or merged-range condition is required for the problem cell.
- Be sure that it is set to General or Text format.
- Cut or copy and paste the new, recreated version of cell (or merged range) and paste it over the old, bad version.
- Now, when entering data into the cell, the problem should no longer manifest.
As WebweaverD subsequently posted, he found a solution to his csv import problem. Also, if the cells are being populate via VBA, then the situation gets more complex, as mention by other replies. But if the data is being manually entered, or copied/pasted from another application into a legacy workbook, the problem may be caused by this legacy cell-attribute issue.