?
Solved

No of columns in csv file

Posted on 2011-02-24
8
Medium Priority
?
424 Views
Last Modified: 2012-05-11
is there a limit on the number of columns and data that can be included in a csv file?

I am reading a csv file, and it reads OK till column 28. Column 29-37 is blank (no value) but when i try to read any columns after column # 37, it returns blank, even though there is data.
thanks
0
Comment
Question by:anushahanna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 36

Accepted Solution

by:
mccarl earned 1000 total points
ID: 34976573
What are you reading it with? This may have some bearing on dropping columns, etc, but to directly answer the original question, NO, there is no inherit limit on the number of columns in a csv file. (Except for possible file size limitations imposed by your OS, but I am sure that you will be no where near that)
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34976607
yes, no space limit issue - the file is 6kb.

access code reads through the csv file and puts it in a table.
i put put dummy values in column 29-39.

29&30 work fine... 31 on is an issue.
0
 
LVL 36

Expert Comment

by:mccarl
ID: 34976627
"access" = Microsoft Access? I presume

So, yeah, I guess Access may have some limitation on the number of columns, or if by "access code" you mean that a VBA type function is loading the file, then maybe there is a limitation in that code.
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 6

Author Comment

by:anushahanna
ID: 34976703
it is microsoft access. the code loops through each record and puts data into tables..
0
 
LVL 35

Assisted Solution

by:ste5an
ste5an earned 1000 total points
ID: 34978286
A CSV file has no other limitations then space it needs on disk or any other media where you like to save it. Microsoft Access has a 255 column limit per table and query.

http://office.microsoft.com/en-us/access-help/access-specifications-HP005186808.aspx

Thus you cannot import it entirely, if it has more then 255 columns. In such a case you must use multiple steps to import it into multiple tables if you don't normalize the data structure.

Your original problem is normally caused by the fact that Access snoops into the first 10 records to guess the data type. If this guess is wrong, then in columns may appear data which is not readable while not convertible, thus it is null. You need also to take a look at the raw data, if it is a correctly generated CSV and check whether you have given the import wizard a correct specification of it.


mfG
--> stefan <--
0
 
LVL 46

Expert Comment

by:aikimark
ID: 34985609
@anushahanna

please post a copy of the CSV file.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34985668
thanks aikimark; i just saw that the code had a for loop that only went through the first so many columns - that is why the limitation i faced.

thanks all for your guidance, so I was able to revisit this.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question