Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

'Unpivot' in LINQ/C#

Avatar of Nathan08
Nathan08 asked on
.NET ProgrammingC#
7 Comments1 Solution3294 ViewsLast Modified:
Hi, I have a similar situation to the question linked below.  Basically I have a wide CSV file which looks like (basically):

Person, Status, Date, Answer1, Answer2 ... Answer 200.  
Bob, Done, 1/1/10,5,3, 6,4,2...and so on
Joe, Done, 1/1/10,5,2,2,1,5...and so on

Most answers are numeric, but some questions allow text.

I'd like to end up with:

Person,Status,Date,AnswerNum,AnswerVal
Bob, Done, 1/1/10, 1, 5
Bob, Done, 1/1/10, 2, 3
and so on.

The volume of data is very manageable (maybe a few thousand respondents) and people will probably click an 'upload' button to import the result files- so I'd prefer to avoid SSIS/stored procedures if possible.  Is there a method in LINQ, or a reasonably easy procedure in C# to rework this and append it to a database?  

Many thanks for your thoughts!


https://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_23464968.html?sfQueryTermInfo=1+unpivot
ASKER CERTIFIED SOLUTION
Avatar of Nathan08
Nathan08

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answers