Sponsored Content
Full Discussion: Matrix to 3 col sorted
Top Forums Shell Programming and Scripting Matrix to 3 col sorted Post 303003845 by rdrtx1 on Thursday 21st of September 2017 12:14:16 PM
Old 09-21-2017
Code:
rm -rf output
mkdir output
awk '
NR==1 { for (i=1; i<=NF; i++) a[i]=$i ;}
NR > 1 {
   for (i=4; i<=NF; i++) print "touch output/\"" a[i], $1 "__" $2 "__" $3, $i "\"";
}
' infile | sh

ls -1 output > outfile

This User Gave Thanks to rdrtx1 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Help On col command

Hello Can Any1 tell me the difference between the col command and the col command with the -f option. I tried running both of them but i can't see any difference. Please guide me. (1 Reply)
Discussion started by: rahulrathod
1 Replies

2. Ubuntu

Match col 1 of File 1 with col 1 File 2 and create a 3rd file

Hello, I have a 1.6 GB file that I would like to modify by matching some ids in col1 with the ids in col 1 of file2.txt and save the results into a 3rd file. For example: File 1 has 1411 rows, I ignore how many columns it has (thousands) File 2 has 311 rows, 1 column Would like to... (7 Replies)
Discussion started by: sogi
7 Replies

3. Shell Programming and Scripting

diagonal matrix to square matrix

Hello, all! I am struggling with a short script to read a diagonal matrix for later retrieval. 1.000 0.234 0.435 0.123 0.012 0.102 0.325 0.412 0.087 0.098 1.000 0.111 0.412 0.115 0.058 0.091 0.190 0.045 0.058 1.000 0.205 0.542 0.335 0.054 0.117 0.203 0.125 1.000 0.587 0.159 0.357... (11 Replies)
Discussion started by: yifangt
11 Replies

4. Shell Programming and Scripting

i can't cut the third col

SW_dist_intr false Enable SW distribution of interrupts True autorestart true Automatically REBOOT OS after a crash True boottype disk N/A False capacity_inc 1.00 ... (7 Replies)
Discussion started by: maxim42
7 Replies

5. Shell Programming and Scripting

how to add new col in a file

Hi, Experts, I have a requirement as following: my source file: a a a b b c c c c I need add one more colume as following: 1 a 2 a 3 a 1 b 2 b 1 c 2 c (4 Replies)
Discussion started by: ken002
4 Replies

6. Ubuntu

How to convert full data matrix to linearised left data matrix?

Hi all, Is there a way to convert full data matrix to linearised left data matrix? e.g full data matrix Bh1 Bh2 Bh3 Bh4 Bh5 Bh6 Bh7 Bh1 0 0.241058 0.236129 0.244397 0.237479 0.240767 0.245245 Bh2 0.241058 0 0.240594 0.241931 0.241975 ... (8 Replies)
Discussion started by: evoll
8 Replies

7. UNIX for Advanced & Expert Users

Print line based on highest value of col (B) and repetion of values in col (A)

Hello everyone, I am writing a script to process data from the ATP world tour. I have a file which contains: t=540 y=2011 r=1 p=N409 t=540 y=2011 r=2 p=N409 t=540 y=2011 r=3 p=N409 t=540 y=2011 r=4 p=N409 t=520 y=2011 r=1 p=N409 t=520 y=2011 r=2 p=N409 t=520 y=2011 r=3 p=N409 The... (4 Replies)
Discussion started by: imahmoud
4 Replies

8. Shell Programming and Scripting

awk? adjacency matrix to adjacency list / correlation matrix to list

Hi everyone I am very new at awk but think that that might be the best strategy for this. I have a matrix very similar to a correlation matrix and in practical terms I need to convert it into a list containing the values from the matrix (one value per line) with the first field of the line (row... (5 Replies)
Discussion started by: stonemonkey
5 Replies

9. Shell Programming and Scripting

Printing from col x to end of line, except last col

Hello, I have some tab delimited data and I need to move the last col. I could hard code it, awk '{ print $1,$NF,$2,$3,$4,etc }' infile > outfile but it would be nice to know the syntax to print a range cols. I know in cut you can do, cut -f 1,4-8,11- to print fields 1,... (8 Replies)
Discussion started by: LMHmedchem
8 Replies

10. Shell Programming and Scripting

Modifying col values based on another col

Hi, Please help with this. I have several excel files (with and .xlsx format) with 10-15 columns each. They all have the same type of data but the columns are not ordered in the same way. Here is a 3 column example. What I want to do add the alphabet from column 2 to column 3, provided... (9 Replies)
Discussion started by: newbie83
9 Replies
Gtk2::ListStore(3)					User Contributed Perl Documentation					Gtk2::ListStore(3)

NAME
Gtk2::ListStore HIERARCHY
Glib::Object +----Gtk2::ListStore INTERFACES
Gtk2::TreeModel Gtk2::TreeDragSource Gtk2::TreeDragDest Gtk2::TreeSortable Gtk2::Buildable METHODS
liststore = Gtk2::ListStore->new (...) o ... (list) of strings treeiter = $list_store->append $list_store->clear $list_store->set_column_types (...) o ... (list) of strings $list_store->set ($iter, $col1, $val1, ...) o $iter (Gtk2::TreeIter) o $col1 (integer) the first column number o $val1 (scalar) the first value o ... (list) pairs of column numbers and values treeiter = $list_store->insert ($position) o $position (integer) treeiter = $list_store->insert_after ($sibling) o $sibling (Gtk2::TreeIter or undef) treeiter = $list_store->insert_before ($sibling) o $sibling (Gtk2::TreeIter or undef) treeiter = $list_store->insert_with_values ($position, ...) o $position (integer) position to insert the new row o ... (list) pairs of column numbers and values Like doing insert followed by set, except that insert_with_values emits only the row-inserted signal, rather than row-inserted, row- changed, and, if the store is sorted, rows-reordered as in the multiple-operation case. Since emitting the rows-reordered signal repeatedly can affect the performance of the program, insert_with_values should generally be preferred when inserting rows in a sorted list store. Since: gtk+ 2.6 boolean = $list_store->iter_is_valid ($iter) o $iter (Gtk2::TreeIter) Since: gtk+ 2.2 $store->move_after ($iter, $position) o $iter (Gtk2::TreeIter) o $position (Gtk2::TreeIter or undef) Since: gtk+ 2.2 $store->move_before ($iter, $position) o $iter (Gtk2::TreeIter) o $position (Gtk2::TreeIter or undef) Since: gtk+ 2.2 treeiter = $list_store->prepend boolean = $list_store->remove ($iter) o $iter (Gtk2::TreeIter) $store->reorder (...) o ... (list) of integers the reordered posistions Reorders store to follow the order indicated by new_order. Note that this function only works with unsorted stores. A list of position should be passed, one for each item in the list. Since: gtk+ 2.2 $store->swap ($a, $b) o $a (Gtk2::TreeIter) o $b (Gtk2::TreeIter) Since: gtk+ 2.2 $list_store->set_value ($iter, $col, $val) o $iter (Gtk2::TreeIter) o $val (scalar) o $col (integer) SEE ALSO
Gtk2, Glib::Object COPYRIGHT
Copyright (C) 2003-2008 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.12.1 2010-07-05 Gtk2::ListStore(3)
All times are GMT -4. The time now is 02:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy