tanaike

The Thinker

Removing Quote Prefix of Cell value using Google Apps Script (Single Quote)

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.

Split Binary Data with Search Data using Google Apps Script

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.

Exporting Google Docs Files in PDF format with Batch Requests using Google Apps Script

Gists This is a sample script for exporting Google Docs files (Spreadsheets, Documents, and so on) in PDF format with batch requests using Google Apps Script. I have published a report “Efficient File Management using Batch Requests with Google Apps Script”. In this report, I mentioned how to use the batch requests using Google Apps Script. In this post, I would like to introduce the method for retrieving binary data using this method.

Updated: GAS Library - BatchRequest

BatchRequest was updated to v1.2.1. v1.2.1 (March 8, 2023) An option of exportDataAsBlob was added to the request object to the method of EDo(). Ref When this option is used, the response values from the batch requests are returned as Blob. By this, for example, when you export Google Spreadsheet as PDF data using the batch requests, the PDF data can be retrieved as Blob. Sample script using exportDataAsBlob In this sample, the Spreadsheet and Document files are exported as PDF format using the batch requests.

Resumable Download of File from Google Drive using Drive API with Python

Gists This is a sample script for achieving the resumable download of a file from Google Drive using Dive API with Python. There might be a case in that you want to achieve the resumable download of a file from Google Drive using Dive API with Python. For example, when a large file is downloaded, the downloading might be stopped in the middle of downloading. At that time, you might want to resume the download.