Paste from excel

Paste from excel

Hi

I am trying to provide an easy import from excel feature to the user. They can copy paste some values from the excel template to the webinterface. However when excel has a multiline cell (I mean a cell with a break (or multiple) in it, not merged cells).

Example:
Col1            Col2
Test1           Res1
Test2           Res2a
                   Res2b
Test3           Res3
Test4           Res4a
                   Res4b
                   Res4c
(The multiline can be an unknown amount of lines)


I want to import these and add them to a form with a textarea per field so 2 fields per row.

Now i can do this for the singleline cells, however how can I use this for the multiline?
I am thinking for something in the split, however I can not figure out what. I tried some regexpressions, but I', not so well known with these.

code used:
  1. var data = $("#import_text").val();                    
  2.  var arr = data.split( /[\r\n]/g );
  3.       $.each(arr, function(i){
  4.             row = arr[i].split( /\t/ );
  5.             col1 = $.trim(row[0]);
  6.             col2 = $.trim(row[1]);
  7.             //Set values and such
  8.        }
  9. });
When copying from excel the export is 
Test1 (tab) Res1 (break)
Test2 (tab) "Res2a (break)
Res2b"(break)
Test3 (tab) "Res3 (break)

Test4 (tab) "Res4a (break)
Res4b (break)
Res4c"(break)