I'm looking for the functionality to process data from Google Sheets, Excel and plain HTML tables.
I'm using clipboard data on paste event to get the contents of clipboard.
var clipText = event.clipboardData.getData('text/plain');
Though I not quite sure how to process the data and which symbols are used to delimit the rows and the columns. Ideally I would like to have an array of rows with array of columns.
Holidays taken in the last six months
ID Name July August September October November December
215 Abel 5 2 0 0 0 3
231 Annette 0 5 3 0 0 6
173 Bernard 2 0 0 5 0 0
141 Gerald 0 10 0 0 0 8
99 Michael 8 8 8 8 0 4
So e.g. a plain copy from HTML is results in this format, some cells are delimited with 3 spaces and some with 2 (Gerald 10 -> 0)
My desired result:
[
[ID, Name, July, August, September, October, November, December],
[215, Abel, 5, 2, 0, 0, 0, 3],
[231, Annette, 5, 3, 0, 0, 0, 3]
...
]
Are there any special characters that can be used to break / delimit the tabular data from clipboard?