textarea split on newline
$(function(){
var lines = [];
$.each($('#data').val().split(/\n/), function(i, line){
if(line){
lines.push(line);
} else {
lines.push("");
}
});
console.log(lines);
});