Convert a Multi-row-based Table to a Regular Row-wise Table
In the following Excel table, each of odd numbered rows contains unduplicated key words in all its cells and each even numbered row contains values corresponding to the key words in all cells.
Task: Convert the table to a regular two-column row-wise table, where column 1 contains key words and column 2 contains the corresponding values. The expected result table is as follows:
Directions:
1. Start esProc (Download esProc installation package and free DSK edition license HERE. You will be prompted to load the license file when you run esProc for the first time).
2. Open the to-be-computed file in Excel, select the area of A1:E6, and press Ctrl+C to copy it to the clipboard.
3. Open esProc, select cell A1, and press Ctrl+V to paste data from the clipboard to A1. Make sure that the caret is placed above A1 in its editing status during the pasting.
4. Write the following script in esProc.
In this script, step(2,1) gets all odd numbered rows. conj() concatenates values of the rwos into a single-column table. Thus A3 gets a column of key words and A4 gets a column of values. A5 then joins them together, during which carriage return and tab are used to separate rows and columns respectively.
5. Press F9 to execute the SQL script. Then you can click A5 to view the result in the value viewing section on the right. Click the “Copy data” button on the right-hand to paste A5’s result to clipboard.
6. Switch back to Excel to select any cell and press Ctrl+V to paste the result in.