LibreOffice: ODT to PDF conversion hangs in parallel
Converting documents from a PHP script with headless LibreOffice:
<?php
$cmd = 'export HOME=/tmp && cd /tmp && libreoffice --headless --convert-to pdf ~/16c6801746f3e924b254abb0089f0a0f.odt';
exec($cmd, $output, $retCode);
sometimes hangs when several conversions run at the same time. The problem is shared access to /tmp/.config and /tmp/.cache by the same user (apache) from different processes.
The solution: create a separate temporary subdirectory for every conversion and pass it as HOME.
LibreOffice Calc: transpose rows to columns
- Copy the cell range you want to transpose.
- Use Paste Special, and in the dialog check Paste all and Transpose.
Reference: Rotating Tables (Transposing) — LibreOffice Help
Google Sheets: delete many sheets at once
Open Tools > Script editor and run the function below. It deletes every sheet except the one named 21-01. To check what will be deleted, set a breakpoint at the console.log line and run it in debug mode first.
function DeleteAllSheets() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
console.log("Doc: " + ss.getName());
var sheets = ss.getSheets();
for (i = 0; i < sheets.length; i++) {
switch (sheets[i].getSheetName()) {
case "21-01":
break;
default:
console.log("Delete: " + sheets[i].getSheetName());
ss.deleteSheet(sheets[i]);
}
}
}
Source: spreadsheetpoint.com
