I am trying to use Google Apps Script to take a CSV of my aviation logbook and populate a template, 16 lines at a time, until reaching the end of my entries. The logbook exists in a Google Sheets file right now, as does the template.
My question is: -Is it okay to have my template already across two individual sheets and achieve these results?
My vision for the process is:
Export sheets file to CSV (no headers for match reference, but columns will never change order to accommodate indexing).
Take data from CSV in 16-line chunks and plug into template. (while loop?) (Template has two sheets for left and right sides of a logbook)
Populate bottom three rows with sum of relevant column of current chunk of 16 lines (1), sum of relevant column prior to line 1 of current 16 line chunk if it exists (2), and sum of relevant column From beginning of data to end of current 16 line chunk (3).
Save each completed template as a new sheet or file to eventually be strung together.
Repeat the process until reaching the end of the entries contained in CSV.
Compile all of the "pages", alternating left and right, and save as PDF.
The template has two sheets inside to mimmic the left and right side of an open book and make the final format easily printable. I would like to achieve all of this with Google Apps Script to avoid having to download/upload files and do it through a third party.
Template- https://docs.google.com/spreadsheets/d/1CWVaFWFJJdaEk9mvHy2yuh_ACSsuIG9u6faggEwNzVc/edit?usp=sharing