Moving many rows simultaneously

Discuss the spreadsheet application
Post Reply
markc7
Posts: 2
Joined: Tue May 13, 2008 10:15 pm

Moving many rows simultaneously

Post by markc7 »

Hi folks, I was wondering if any of you had a trick up your sleeve that could help me out here.

I need to move a whole bunch of rows, and I have too much data to do each row manually. Because of the format of the output file of another program, my data is arranged like this (also see attachment):

Subject # | Condition | Interval | Channel

4 CNS 1 3 data data data data
4 CNS 1 3 data data data data
4 CNS 1 4 data data data data
4 CNS 1 4 data data data data
4 CNS 2 3 data data data data
4 CNS 2 3 data data data data


As you can see, every pair of rows is the same subject, condition, interval, and channel. The data from each of the two rows should go together in a single row, like this:

4 CNS 1 3 data data data data data data data data
4 CNS 1 4 data data data data data data data data
4 CNS 2 3 data data data data data data data data

I know that I can copy and paste the data from the second row into the first row, the delete the now empty second row. But I have 40,000 rows of data so I very much would like to find an easier way of doing this.

Any thoughts? Does my question even make sense?
Attachments
data_Oocalc.jpg
Dave
Posts: 1011
Joined: Sun Dec 23, 2007 6:53 pm

Re: Moving many rows simultaneously

Post by Dave »

I used your initial "data, data... example imported into Calc, so let's go by that for example.

With this in columns A through H,

4 CNS 1 3 data data data data
4 CNS 1 3 data data data data
4 CNS 1 4 data data data data
4 CNS 1 4 data data data data
4 CNS 2 3 data data data data
4 CNS 2 3 data data data data

In I1 put =E2. In J1 put =F2. ...to fill row 1 from row 2. You can do this by dragging across the row, once you've done the first.


Select data in rows 1 through 2, including any empty cells as necessary. Then, using the lower right cell, in its lower right you'll see a "+" cursor. Use that to drag this information down as far as you need. That will copy this procedure without further effort, although Fill Down might work better for a lot of data.

Now, you should have the data you want from rows 2, 4, 6, ... added to rows 1, 3, 5, ... .

To see only the data you want [rows 1, 3, 5,..] you will need to use Data Filter, Standard. Choose Column I, <>. Do not add anything in the value box. This will filter so that you see only the data you need to see [and print, etc.]

David.
markc7
Posts: 2
Joined: Tue May 13, 2008 10:15 pm

Re: Moving many rows simultaneously

Post by markc7 »

You are a genius Dave, thanks a bunch!
Dave
Posts: 1011
Joined: Sun Dec 23, 2007 6:53 pm

Re: Moving many rows simultaneously

Post by Dave »

Aw, shucks!

Seriously, let me nip that in the bud right now. I am here to learn from the many other contributors who REALLY know what they are doing [I gave up programming long ago, and did just enough then to realise how difficult it can get.] I choose the easier problems. There just happen to be more of those.

David.
Post Reply