Gists
When a value is searched from the 1-dimensional array and a 2-dimensional array, after V8 runtime could be used, I use JSON object, Set object, and Map Object. But, I had never measured the process cost of this situation. In this post, I would like to introduce the process cost for searching a value using a JSON object, Set object, and Map object converted from the 1-dimensional array and 2-dimensional array.
Gists
This is a sample script for importing Microsoft Excel (XLSX) data to Google Spreadsheet using a custom function with Google Apps Script.
Usage 1. Install SheetJS library. Please copy the script of the SheetJS library from https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js, and paste the script to the script editor of Google Spreadsheet, and save the script.
In this case, I would like to recommend the following flow.
Add a new script to the script editor.
Gists
Updated on July 8, 2023
In the current stage, unfortunately, the built-in methods of Google Apps Script cannot directly retrieve the values from the XLSX data. From this situation, I have created DocsServiceApp. When this Google Apps Script library is used, the values are directly retrieved from XLSX data by parsing XML data of XLSX data.
Here, as another approach, I would like to introduce a sample script for directly retrieving the values from XLSX data using SheetJS with Google Apps Script.
Gists
In Google Spreadsheet, when a single quote is added to the top letter of the cell value, the cell is used as the text value. About detecting this, I have already reported in this post in my blog. In this post, I would like to introduce a sample script for removing the single quote at the top character of the cell value.
Sample script: function sample() { const sheetName = "Sheet1"; // Please set your sheet name.
Gists
This is a sample script for splitting the binary data with search data using Google Apps Script.
Sample script /** * Split byteArray by a search data. * @param {Array} baseData Input byteArray of base data. * @param {Array} searchData Input byteArray of search data using split. * @return {Array} An array including byteArray. */ function splitByteArrayBySearchData_(baseData, searchData) { if (!Array.isArray(baseData) || !Array.isArray(searchData)) { throw new Error("Please give byte array.