I am working with Google documents that contain hundreds of empty paragraphs. I want to remove these blank lines automatically.
In LibreOffice Writer you can use th
I think there has to be a last empty paragraph but this seems to work.
function myFunction() {
var body = DocumentApp.getActiveDocument().getBody();
var paras = body.getParagraphs();
var i = 0;
for (var i = 0; i < paras.length; i++) {
if (paras[i].getText() === ""){
paras[i].removeFromParent()
}
}
}