Skip to content

@eightkk/vue-weave / core / parseSheetText

Function: parseSheetText() ​

parseSheetText(text): string[][]

Defined in: src/core/sheetEditing.ts:14

Read tab-separated clipboard text into records of cells, the way spreadsheet applications write it.

Records end at CRLF, LF or CR; one line break at the end of the text is ignored, so a\tb\r\n is one record. A cell that starts with a double quote is read as quoted (doubled quotes inside it become one, and it may span lines) only when its closing quote is followed by a tab, a line break or the end of the text. Otherwise the quote is ordinary text, so 5" bolt and "A" grade read as written. Empty text is one empty cell. Never throws for a string.

Parameters ​

text ​

string

Returns ​

string[][]

Released under the MIT License.