Jump to content

embedded while loop


sbrinley

Recommended Posts

I am trying to take a list of data with two columns and separate it out into a structured table. Here is a sample list of the data

 

Parent Child

D61120901GAT R61120901GAT

R61120901GAT R61120801GAT

R61120801GAT R61120801GAA

R61120801GAA R61120701GAT

R61120701GAT R61120601GAT

R61120601GAT R61120501GAT

R61120501GAT R61120003GAT

 

This is the list I want to turn into this

 

D61120901GAT

R61120901GAT

R61120801GAT

R61120801GAA

R61120701GAT

R61120601GAT

R61120501GAT

R61120003GAT

 

The parent might have up to 10 children deep in total. Also the parent might have two or more direct children.

for example:

 

D61120901GAT

R61120901GAT

R61120801GAT

R61121901GAT

R61121801GAT

 

Also even though the numbers seem to go into order here they don't in every part. A typical list size is about 20k lines long.

 

I've tried a few different while loops without success. I fear I might be over complicating it or not looping correctly. If anyone has some ideas or a solutions I would appreciate it!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.