Im trying to take the value of textarea, split it into different properties.
Data in textfield(This is an example, there is alot more spaces in the real input):
name lastname age fruit
john doe 22 apple
eric jonsson 23 apple
This Is my code right now:
var textareadataData = $('#textareaID').val().split('\n');
Result:
" name lastname age fruit"
" john doe 22 apple"
"eric jonsson 23 apple"
I want the result to be:
"name","lastname","age","fruit"
"john","doe","22";"apple"
"eric", "jonsson","23","apple"
I've tried to search around but didn't find the answer.
Best Regards Wiak