I have a line of items in Excel, and when I copy them in a textarea, I have several tab characters. I use this on purpose. Is there a way to replace n-th tab characters with a new line (each) and insert a specific word for each tab? Here is what I have so far http://jsfiddle.net/kjuxk7m9/
<textarea rows="10" cols="50" onblur="this.value=this.value.replace(/\t/g, '\n')">
Basically, when I enter the following in a textarea:
Item1 Item2 Item3 Item4 Item5
(between items are tab characters), my result would have to be:
Name1: Item1
Name2: Item2
Name3: Item3
Name4: Item4
Name5: Item5
Also, I might have more than one tab characters one after another. I would need them removed, so that I just have no empty lines after replacing them with new line char. Also, I would rather not use inline javascript, even if I did so far in the example.
Thanks!
UPDATE:
Input text:
Item1 Item2 Item3 Item4 item6 Item7
The expected result is:
LastName: Item1
FirstName: Item2
PhoneNumber: Item3
Nickname: Item4
AnotherRandomCategory:
Blog: Item6
OtherDetail: Item7
Item5 practically is an example of empty cell in my spreadsheet, and copying that would add an extra tab character. After having the above result, I would be able to delete that line, with a code, since that category does not have an item. The Items are examples, they are actually names, numbers, and other data. Thanks!

