21300 Posts in 5735 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 191 Views |
-
CVS import - unknown number of columns

17 May 2012 at 5:42pm
Hi,
I have a situation where my client will be uploading CSV files.
The first column defines various 'questons', and the subsequent rows define different peoples answers.
There are about 100 rows (questions), and the number of columns (answers) keeps growing.
Instead of creating a database table with all the rows matching the CSV file, I was thinking of having a table with 'question, answer, name'
name is the name of the person - which is the first question.So
name: jon , Stu , Bob
age: 31, 20, 56
nationality: uk, nz, usa
height: 5ft, 6ft,2ftbecomes a serious of rows
question: answer: name
age: 31, jon
nationality: uk, jon
height: 5ft, jon
age: 20, Stu
nationality: nz, Stu
height: 6ft, Stu
age: 56, Bob
nationality: usa, Bob
height: 2ft, BobI would easily be able to search through this, and if the client adds more questions (rows) to the CSV file they just get loaded in.
However, I'm not really sure where to start... Anyone have any ideas?
-
Re: CVS import - unknown number of columns

17 May 2012 at 8:08pm
Hi,
Look into extending "CsvBulkLoader". function processRecord this will allow you to read the csv and write to any number of dataobjects with any logic that you require
| 191 Views | ||
|
Page:
1
|
Go to Top |


