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
EYED3(1)																  EYED3(1)

NAME
eyeD3 - displays and manipulates id3-tags on mp3 files SYNOPSIS
eyeD3 [options] file [file...] eyeD3 [options] dir [dir...] DESCRIPTION
eyeD3 Manipulates ID3 tags in mp3 files and is able to read/write and convert between ID3 v1.0, v1.1, v2.3 and v2.4 tags. High-level access is provided to most frames, including APIC (i.e., images) frames. OPTIONS
-h, --help Shows a brief help string and exit. --version Show program's version number and exit. --no-color Disable color output. -v, --verbose Show all available tag information. --debug Trace program execution; for debugging. TAG VERSIONS
-1, --v1 Only read/write ID3 v1 tags. By default, v1 tags are only read if there is not a v2 tag. -2, --v2 Only read/write ID3 v2.x tags. --to-v1.1 Convert the file's tag to ID3 v1.1. (Or 1.0 if there is no track number) --to-v2.3 Convert the file's tag to ID3 v2.3. --to-v2.4 Convert the file's tag to ID3 v2.4 TAG DATA
Options for manipulating tag data have the side-effect of removing a frame when the data specified is the empty string. For example, --artist="" (or -a "") would cause the artist frame to be removed. This is especially useful for removing comment frames. -a STRING, --artist=STRING Set artist the to STRING. -A STRING, --album=STRING Set album to STRING. -t STRING, --title=STRING Set track title to STRING. -n NUM, --track=NUM Set track number to NUM. -N NUM, --track-total=NUM Set total number of tracks to NUM. -G STRING, --genre=STRING Sets genre to STRING. (See --list-genres) -Y YEAR, --year=YEAR Set the four digit year. -p STRING, --publisher=STRING Set the publisher/label text. --comment=[LANGUAGE]:DESCRIPTION:COMMENT Add (or remove when COMMENT is "") a comment. Note that the argument value MUST always contain exactly two ':' characters to delimit the fields even when the default language is being used. The DESCRIPTION string is the comment title. The optional LAN- GUAGE string MUST be a three-character ISO 639 language code. The default is "eng" for English. A tag may not have more than one comment frame with the same DESCRIPTION and LANGUAGE values. --remove-comments Remove all comment frames from the tag. --lyrics=[LANGUAGE]:DESCRIPTION:LYRICS Add (or remove when LYRICS is "") a comment. Note that the argument value MUST always contain exactly two ':' characters to delimit the fields even when the default language is being used. The DESCRIPTION string is the lyrics title. The optional LANGUAGE string MUST be a three-character ISO 639 language code. The default is "eng" for English. A tag may not have more than one lyrics frame with the same DESCRIPTION and LANGUAGE values. --remove-lyrics Remove all lyrics frames from the tag. --add-image=IMG_PATH:TYPE[:DESCRIPTION] Add an image to the tag (APIC frame). The IMG_PATH is the image file to add to the tag. If the path value is empty the image frame with a value of TYPE is removed from the tag. The TYPE is one of the types listed when 'eyeD3 --list-image-types' is run. The DESCRIPTION is optional and will default to "". A tag may not have more than one image frame with the same TYPE values. --remove-images Remove all image (APIC) frames from the tag. --add-object=OBJ_PATH[:DESCRIPTION[:MIME-TYPE[:FILENAME]]] Add an encapsulated object to the tag (GEOB frame). The description and filename are optional, but when used, the ':' delimiters must be present. If the OBJ_PATH value is empty the GEOB frame with DESCRIPTION is removed. A tag may not have more than one object (GEOB) frame with the same DESCRIPTION values. -i DIR, --write-images=DIR Causes all attached images (APIC frames) to be written to the specified directory. They are named by their "image type". For exam- ple, if the image is a png and the type is OTHER, a file named OTHER.png is written to the desired directory. If the file name already exist, a unique numeric value is appended to the type string. -o DIR, --write-objects=DIR Causes all attached objects (GEOB frames) to be written to the specified directory. The files are written with the name "<file- name>.<mime-subtype>" in the specified directory. --set-text-frame=FID:TEXT Set the value of a specific (i.e., FID) text frame. To remove the frame, specify an empty value. e.g., --set-text-frame="TDRC:" --set-user-text-frame=DESC:TEXT Set the value of a TXXX text frame with a unique description. To remove the frame, specify an empty value. e.g., --set-user-text- frame="Description:" --set-url-frame=FID:URL Set the value of a specific (i.e., FID) URL frame. To remove the frame, specify an empty URL. e.g., --set-url-frame="WCOM:" --set-user-url-frame=DESC:URL Set the value of a WXXX frame with unique description string. To remove the frame, specify an empty URL. e.g., --set-user-url- frame="Description:" --play-count=[+]N Set the play count (PCNT). If the argument value begins with '+' the value is incremented by N, otherwise it is set to exactly N. --bpm=N Set the beats per minute value. The value MUST be greater than 0. --unique-file-id=OWNER_ID:ID Add a UFID frame. If the ID arg is empty the UFID frame with OWNER_ID is removed. An OWNER_ID MUST be specified. --set-encoding=latin1|utf8|utf16-LE|utf16-BE Set the encoding that is used for _all_ text frames in the tag. The encoding is applied only when the tag is updated, therefore a frame must be set or --force-update is present. Note that, unfortunately, utf8 is not supported by ID3 v2.3 tags. --remove-v1 Remove ID3 v1.x tag. --remove-v2 Remove ID3 v2.x tag. --remove-all Remove all tags. MISC. OPTIONS --rename=PATTERN Rename the file based on PATTERN which may contain the following substitution variables: %A (artist), %a (album), %t (title), %n (track number), and %N (the total track count). The PATTERN string MUST not contain the file name extenstion. --fs-encoding=ENCODING Use the specified character encoding for filenames when renaming files. The default value is iso-8859-1. -l, --list-genres Display the table of "valid" ID3 genres and exit. --list-image-types List all possible image types for APIC frames. --strict Fail for tags that violate the ID3 specification. --jep-118 Output the tag per the format described in JEP-0118. See http://www.xmpp.org/extensions/xep-0118.html --nfo Output NFO information for each album directory. --lametag Prints the LAME Tag. --force-update Update the tag regardless of whether any frames were set on the command line. --no-zero-padding Don't pad track or disc numbers with 0's. --no-tagging-time-frame When saving tags do not add a TDTG (tagging time) frame. -F DELIM Specify a new delimiter for option values that contain multiple fields (default delimiter is ':') SEE ALSO
http://eyed3.nicfit.net/ AUTHOR
eyeD3 was written by Travis Shirk <travis@pobox.com>. This manpage was written by Alexander Wirt <formorer@debian.org> for the Debian Dis- tribution and Travis Shirk. eyeD3 0.6.18 Jun. 29, 2012 EYED3(1)
All times are GMT -4. The time now is 05:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy