How to Insert an Empty Row Wherever the Excel Cell Value Is Changed

chuxin huo
Jan 25, 2021

--

We have an Excel file book1.xlsxcontaining data as follows:

Now we need to insert an empty row each time the cell value is different. The expected table is as follows:

It is convenient to do this in esProc.
You can download esProc installation package and a freeDSKlicense file HERE.

1. Write script p1.dfxin esProc:

A1 Read in data of book1.xlsx; @w option enables reading data as a sequence of sequences.

A2 Create a new group whenever the cell value changes and insert an empty row at the end of the last group, and then concatenate all groups.

A3 Export A2’s result to book2.xlsx; @w option enables outputting data as a sequence of sequences.

2. Execute the script to get the desired table in book2.xlsx.

--

--