mercredi 29 juin 2016

Algorithm for creating random lists from an existing list in bash

I have a list of IDs like below:

xxx_date1
xxx_date2
xxx_date3
yyy_date1
yyy_date2
zzz_date1
xyy_date1
xyy_date1
...
...

xxx_date1 and xxx_date2 means that subject xxx had separate visits at date1 and date2. I need to write a script in bash to create random lists (of equal size) of only unique IDs. an example would be like below:

xxx_date1
yyy_date1
zzz_date1
xyy_date1
...

a second list could be:

xxx_date2
yyy_date1
zzz_date1
xyy_date1
...

How can I create all possible lists of unique IDs? I appreciate any hint or idea.

Thank you!




Aucun commentaire:

Enregistrer un commentaire