Copy-Paste in Minitab using Session Commands

A

arnonneder

Hi,

I wrote a script that fetches data from a database into Minitab.
The problem that I encountered is that once the data is in Minitab, I can't find a way to copy-paste a full row into another one using session commands (I looked all over the 'session commands' section in the Help menu).
The only possible option I found was to copy-paste a cell into another cell using 'LET', so I wrote a matrix that copies each cell from one row and paste it into the corresponding cell in another row, but I need to do that for each cell separately, I can't copy the whole row at once and copy it to another row.

What I wrote is :

LET C1[1] = C1[236]
LET C2[1] = C2[236]
LET C3[1] = C3[236]
LET C4[1] = C4[236]
LET C5[1] = C5[236]

means that I copy the cell at Column C1-Row 236 and paste it to cell at Column C1-Row 1, then copy the cell at Column C2-Row 236 and paste it to cell at C2-Row 1, etc.

This is tedious, especially if you have more than 5 columns.

Does anyone know how to copy-paste a row to a different one with a single command?

Thanks!
 

Miner

Forum Moderator
Leader
Admin
Try the COPY command. There is a subcommand INCLUDE with a ROWS K:K option. You can then specify a target location using NEWWS, AFTER or STORE. The target location is limited to a global macro, and cannot be used in a local macro. Use AFTER to append to the bottom of the worksheet. Use STORE in conjunction with INSERT to place in in specified rows.
 
A

arnonneder

Thanks for the quick reply.

Let's say I have 5 rows and 5 columns, and I want to copy the 5th row and paste it between rows 2 and 3.
I got this far:

COPY;
INCLUDE;
ROWS 5;

What should I write next?

Thanks!
 

Miner

Forum Moderator
Leader
Admin
This is totally from memory. Follow with the STORE subcommand then use the INSERT command.
 

Miner

Forum Moderator
Leader
Admin
The COPY command is formatted as follows:

Copy C1-C3;
Include;
Rows 4 5;
Store "Worksheet 1" C101-C103.

I am still working out the INSERT command.
 
A

arnonneder

Thanks!

I'll try to continue as well with the INSERT command.
 
Top Bottom