Fill up a number of blank lines every N rows

Example

The Excel file book1.xlsx contains the detailed data of the student examination room and seats, and some of the data is shown in the figure below:

Use these data to make a report. Every 40 people are arranged in a classroom on one page. A total of 7 rows and 6 columns show the seat map. Each page prints 42 cards. In addition to 40 students’ cards, each page needs to show two vacancies. Two empty records should be added after every 40 records in the original records.

Write SPL script:


A

1

=T("e:/work/book1.xlsx")

2

=row=A1.create().insert(0)

3

=A1.group((#-1)\40).(~|row|row).conj()

4

=T("e:/work/book2.xlsx",A3)

A1 Read in book1.xlsx file data 

A2 Copy the data structure of A1, insert an empty record, and assign this record to the variable row 

A3 Every 40 students are divided into a group, and two empty rows are added to the back of each group, and then each group is combined into a data set 

A4 Save the results in A3 to the file book2.xlsx