Sponsored Content
Full Discussion: [Solved] Permutation
Top Forums Shell Programming and Scripting [Solved] Permutation Post 302757497 by johnkim0806 on Thursday 17th of January 2013 03:12:20 PM
Old 01-17-2013
[Solved] Permutation

Hi, I am trying to permutate each column (Except for IDS).

file.txt

Code:
 
FID IID TOAST1 TOAST2 TOAST3
ID3 ID3 1 -9 2
ID4 ID4 2 1 1
ID1 ID1 -9 -9 1
ID8 ID8 1 1 -9
ID12 ID12 1 2 2

for toast1 column, there are two 1's, two 2's and one -9. Having the same number of denominations, I want to permute the TOAST1

Code:
TOAST1
1
1
2
2
-9

is one way, the another way will be

Code:
TOAST1
2
1
2
-9
1

I would like to do this in a loop so that I can permutate each column (not the IDs) automatically.
I would also want to permuate toast2 toast3 and have the results as an one file.

one output might be
Code:
FID IID TOAST1 TOAST2 TOAST3
ID3 ID3 2 1 1
ID4 ID4 1 -9 1
ID1 ID1 -9 -9 2
ID8 ID8 1 1 2
ID12 ID12 1 2 -9

Hope this makes sense!
Thanks!

Moderator's Comments:
Mod Comment Please use code tags for code and data NOT quote tags

Last edited by Scrutinizer; 01-17-2013 at 04:31 PM.. Reason: quote tags - > code tags
 

8 More Discussions You Might Find Interesting

1. What is on Your Mind?

How To Analyze This (Cryptography Random?) Permutation...?

Hi to all of you guys, I'm new here... May this thread fits on this section. A friend of mine gave me this enigma to do, written in excel. I attach the file below, name New.xls. Enigma: There are 10^20 possibilities of tables (Table1, Table 2, Table 3, Table 4, Table 5,...), with ten rows (row... (3 Replies)
Discussion started by: lucky7
3 Replies

2. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

3. Solaris

Looking for cooltst.pl[solved]

Never mind. Found what I was looking for. (1 Reply)
Discussion started by: System Shock
1 Replies

4. HP-UX

[Solved] Sendmail again

Hello experts! Can someone help me to configure sendmail v8.9.3 in HP-UX 10.2? I would like to be able to send messages using an external SMTP server. I have configured the DNS - I can ping my smtp server. I dont know how to configure sendmail. In my system there is no file "sendmail.mc"...... (12 Replies)
Discussion started by: wojciech
12 Replies

5. Shell Programming and Scripting

Arbitrary permutation and combination script

#!/bin/bash # permutation_combination.sh # Version: 2.0 # Author : YongYe <complex.invoke@gmail.com> arg0=-1 argv=${3} number=${2} eval ary=({1..${1}}) length=${#ary} percom(){ nsloop i ${1} number${2} ${3} ${4} ${5}; } invoke(){ echo $(percom ${argu} nsloop -1) prtcom $(percom... (1 Reply)
Discussion started by: complex.invoke
1 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Crontab

Hi I need my script to run at 7:30, 7:40, 7:50 & 8:00 AM. Defined like: 30,40,50 7,8 * * * sh myscript.sh But this runs even at 8:30, 8:40, 8:50 - which I don't need.. Please advise. (4 Replies)
Discussion started by: ashokvpp
4 Replies

7. Shell Programming and Scripting

[SOLVED] Using expect

Please help me guys with this, its my first time using expect. heres what i wanted to do. inputs are in red sitescope@server:/opt/HP/SiteScope/bin> ./config_tool.sh -i console This wizard enables you you to change the ports assigned to SiteScope, move configuration data from one SiteScope... (0 Replies)
Discussion started by: ryandegreat25
0 Replies

8. Shell Programming and Scripting

Permutation Words in awk

i have 13 different words. I need to get permutations like all combinations of this words: word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 word13 But the combinations only should be 12 words long. Is there a fast efficient way to do this? Maybe with linux tool... (1 Reply)
Discussion started by: watcherpro
1 Replies
ID3_GET_TAG(3)								 1							    ID3_GET_TAG(3)

id3_get_tag - Get all information stored in an ID3 tag

SYNOPSIS
array id3_get_tag (string $filename, [int $version = ID3_BEST]) DESCRIPTION
id3_get_tag(3) is used to get all information stored in the id3 tag of the specified file. PARAMETERS
o $filename - The path to the MP3 file Instead of a filename you may also pass a valid stream resource o $version - Allows you to specify the version of the tag as MP3 files may contain both, version 1.x and version 2.x tags Since version 0.2 id3_get_tag(3) also supports ID3 tags of version 2.2, 2.3 and 2.4. To extract information from these tags, pass one of the con- stants ID3_V2_2, ID3_V2_3 or ID3_V2_4 as the second parameter. ID3 v2.x tags can contain a lot more information about the MP3 file than ID3 v1.x tags. RETURN VALUES
Returns an associative array with various keys like: title, artist, .. The key genre will contain an integer between 0 and 147. You may use id3_get_genre_name(3) to convert it to a human readable string. EXAMPLES
Example #1 id3_get_tag(3) example <?php $tag = id3_get_tag( "path/to/example.mp3" ); print_r($tag); ?> The above example will output something similar to: Array ( [title] => DN-38416 [artist] => Re:Legion [album] => Reflections [year] => 2004 [genre] => 19 ) Example #2 id3_get_tag(3) example <?php $tag = id3_get_tag( "path/to/example2.mp3", ID3_V2_3 ); print_r($tag); ?> The above example will output something similar to: Array ( [copyright] => Dirty Mac [originalArtist] => Dirty Mac [composer] => Marcus Gotze [artist] => Dirty Mac [title] => Little Big Man [album] => Demo-Tape [track] => 5/12 [genre] => (17)Rock [year] => 2001 ) SEE ALSO
id3_set_tag(3), id3_remove_tag(3), id3_get_version(3). PHP Documentation Group ID3_GET_TAG(3)
All times are GMT -4. The time now is 04:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy