Altair RISE
A program to recognize and reward our most engaged community members
Nominate Yourself Now!
Home
Discussions
Community Q&A
An issue with read csv
bernardo_pagnon
Hello all,
so, I am trying to read a csv file, but I noticed something strange. If the first row has 4 entries, and the second row 5 entries, RM only reads the first 4 entries of the second row! It seems that the first row defines how many rows will be read. How can I fix the problem? I have thousands of rows, and I don't want to get into my database to find the row with the largest number of columns.
Regards,
Bernardo
Find more posts tagged with
AI Studio
CSV
Accepted answers
jacobcybulski
I assume that your first row has missing values in the attributes far right? If so, make sure the first row has enough extra commas at the end to create those attributes with missing values. Also, I think that if you have the row with headings this row will create the necessary attributes. That should fix the reading problem.
All comments
jacobcybulski
I assume that your first row has missing values in the attributes far right? If so, make sure the first row has enough extra commas at the end to create those attributes with missing values. Also, I think that if you have the row with headings this row will create the necessary attributes. That should fix the reading problem.
bernardo_pagnon
It did the trick, thanks Jacob!
Best,
Bernardo
jykim
I am having the same problem. And, I like the trick. Thanks to jacobcybulski. However, though typing enough extra commas will solve the problem, it doesn't sound convenient. Best semi-automatic way is probably to move a row with the longest list of columns to the first row. But I wish there was a way to do this automatically through RM setting. Any parameter changes or or setting to do it automatically? I am trying to do Create Association Rules through FP-Growth. So the data set is a grocery shopping data.
Telcontar120
In the Read CSV operator you can specify which row you should use as your header row, so you can always just pick your longest row and use that (and then rename your attributes as needed).
Quick Links
All Categories
Recent Discussions
Activity
Unanswered
日本語 (Japanese)
한국어(Korean)
Groups