Sponsored Content
Full Discussion: Sort a tab file with header.
Top Forums UNIX for Dummies Questions & Answers Sort a tab file with header. Post 302594203 by balajesuri on Monday 30th of January 2012 10:48:26 PM
Old 01-30-2012
Code:
$ cat input
val1    val2    val3    val4
a       b       c       d
m       n       o       p
e       f       g       h
i       j       k       l
$
$
$ head -1 input; sed -n '2,$p' input | sort -k1 -k2
val1    val2    val3    val4
a       b       c       d
e       f       g       h
i       j       k       l
m       n       o       p
$
$

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Add a header to a sort file instruction

Hello, I have a header which I have to add to a sorted file, however if I use cat header sortedfile > newfile, the operation takes 2 minutes as the sorted file is over 400mb. I have noticed that when I sort the 400mb unsorted file, this only takes 14 seconds to create the output. As... (2 Replies)
Discussion started by: clarcombe
2 Replies

2. UNIX for Dummies Questions & Answers

Sort and uniq lines of a file while keeping a header line

So, I have a file that has some duplicate lines. The file has a header line that I would like to keep at the top. I could do this by extracting the header from the file, 'sort -u' the remaining lines, and recombine them. But they are quite big, so if there is a way to do it with a single... (1 Reply)
Discussion started by: Digby
1 Replies

3. Shell Programming and Scripting

sort a report file having header and footer

I am having report file with header and footer . The details in between header and footer are separated by a pipe charater. I want to sort the file by considering multiple columns in between header and footer. pls help (4 Replies)
Discussion started by: suryanarayana
4 Replies

4. Shell Programming and Scripting

[Solved] Append an header to a tab delimited file

Dear All, I would like to find an automatic way to add a given code which belong to a class at the end of the column , for example this is my input file: 0610009O20Rik V$VMYB_01 310 (+) 1 0.971 v-Myb V$EVI1_04 782 (-) 0.763 0.834 Evi-1 V$ELK1_02 1966 (-) 1 0.984 Elk-1... (4 Replies)
Discussion started by: paolo.kunder
4 Replies

5. UNIX for Dummies Questions & Answers

How to add a header to a tab delimited .txt file?

Hi, I have a tab delimited document with 18 columns. My file looks like: comp1000201_c0_seq1 comp1000201_c0 337 183.51 0.00 0.00 0.00 0.00 ---NA--- 337 0 0 - comp1000297_c0_seq1 comp1000297_c0 612 458.50 ... (1 Reply)
Discussion started by: alisrpp
1 Replies

6. UNIX for Dummies Questions & Answers

How can i sort a .txt file without loosing the header information?

Hi, I'm trying to sort 2 different .txt tab delimited files with the command line: sort -k 1b,1 inputfile > outputfile But doing that i'm also sorting the header (that ends at the end of my file). How can i sort a .txt file without sorting the header but conserving the header in the... (3 Replies)
Discussion started by: alisrpp
3 Replies

7. UNIX for Dummies Questions & Answers

Sort tab delimited file according to which rows have missing values

Hello! I have a tab delimited file with values in three columns. Some values occur in all three columns, other values are present in only one or two columns. I would like to sort the file so that rows with no missing values come first, rows with one missing values come next, and rows with two... (9 Replies)
Discussion started by: MBarrett1213
9 Replies

8. UNIX for Dummies Questions & Answers

Sort a las file keep the header as it is

I have several las files with a header and each file start Version and text and before the data starts end up with ~Ascii, then the numbers starts: ------------------------------------------------------------------------- Code: ~Version .....text.... ~Ascii 2 abc 230 1 name 1 abc ... (1 Reply)
Discussion started by: tk2000
1 Replies

9. UNIX for Dummies Questions & Answers

Sort a las file keep the header as it is

I have several las files with a header and each file start Version and text and before the data starts end up with ~Ascii, then the numbers starts: ------------------------------------------------------------------------- ~Version .....text.... ~Ascii 2 abc 230 1 name 1 abc 400 1... (17 Replies)
Discussion started by: tk2000
17 Replies

10. Shell Programming and Scripting

Sort and Split file with header and custom name

Hi, I am using SUN SOLARIS (SunOS sun4v sparc SUNW, T5240). I have a huge data file with header and trailer. This file gets used into an ETL process. ETL skips the header record (which is the first record of the file) and loads the rest of the record. The file can be delimited (comma,... (5 Replies)
Discussion started by: Saanvi1
5 Replies
Gtk2::TreeViewColumn(3) 				User Contributed Perl Documentation				   Gtk2::TreeViewColumn(3)

NAME
Gtk2::TreeViewColumn HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::TreeViewColumn INTERFACES
Gtk2::CellLayout Gtk2::Buildable METHODS
treeviewcolumn = Gtk2::TreeViewColumn->new treeviewcolumn = Gtk2::TreeViewColumn->new_with_attributes ($title, $cell, $attr1, $col1, ...) o $title (string) o $cell (Gtk2::CellRenderer) o ... (list) pairs of attributes and columns o $col1 (integer) the first column o $attr1 (string) the first attribute $tree_column->add_attribute ($cell_renderer, $attribute, $column) o $cell_renderer (Gtk2::CellRenderer) o $attribute (string) o $column (integer) double = $tree_column->get_alignment $tree_column->set_alignment ($xalign) o $xalign (double) $tree_column->set_attributes ($cell_renderer, ..., $col1, $attr1) o $cell_renderer (Gtk2::CellRenderer) o ... (list) pairs of attributes and columns o $col1 (integer) the first column o $attr1 (string) the first attribute $tree_column->set_cell_data_func ($cell_renderer, $func, $data=undef) o $cell_renderer (Gtk2::CellRenderer) o $func (subroutine) o $data (scalar) Install $func as the callback to be used whenever $column needs to set up $cell to render a cell. $func should look like this: sub cell_data_func { my ($column, $cell, $model, $iter, $func_data) = @_; } and should set whatever properties of $cell are required for it to draw the data properly. No return value is expected. (start_pos, width) = $tree_column->cell_get_position ($cell_renderer) o $cell_renderer (Gtk2::CellRenderer) Since: gtk+ 2.2 list = $tree_column->cell_get_size boolean = $tree_column->cell_is_visible list = $tree_column->get_cell_renderers Returns a list of Gtk2::CellRenderer's. $tree_column->cell_set_cell_data ($tree_model, $iter, $is_expander, $is_expanded) o $tree_model (Gtk2::TreeModel) o $iter (Gtk2::TreeIter) o $is_expander (boolean) o $is_expanded (boolean) $tree_column->clear $tree_column->clear_attributes ($cell_renderer) o $cell_renderer (Gtk2::CellRenderer) boolean = $tree_column->get_clickable $tree_column->set_clickable ($clickable) o $clickable (boolean) $tree_column->clicked boolean = $tree_column->get_expand Since: gtk+ 2.4 $tree_column->set_expand ($expand) o $expand (boolean) Since: gtk+ 2.4 integer = $tree_column->get_fixed_width $tree_column->set_fixed_width ($fixed_width) o $fixed_width (integer) $tree_column->focus_cell ($cell) o $cell (Gtk2::CellRenderer) Since: gtk+ 2.2 integer = $tree_column->get_max_width $tree_column->set_max_width ($max_width) o $max_width (integer) integer = $tree_column->get_min_width $tree_column->set_min_width ($min_width) o $min_width (integer) $tree_column->pack_end ($cell, $expand) o $cell (Gtk2::CellRenderer) o $expand (boolean) $tree_column->pack_start ($cell, $expand) o $cell (Gtk2::CellRenderer) o $expand (boolean) $tree_column->queue_resize Since: gtk+ 2.8 boolean = $tree_column->get_reorderable $tree_column->set_reorderable ($reorderable) o $reorderable (boolean) boolean = $tree_column->get_resizable $tree_column->set_resizable ($resizable) o $resizable (boolean) treeviewcolumnsizing = $tree_column->get_sizing $tree_column->set_sizing ($type) o $type (Gtk2::TreeViewColumnSizing) integer = $tree_column->get_sort_column_id $tree_column->set_sort_column_id ($sort_column_id) o $sort_column_id (integer) boolean = $tree_column->get_sort_indicator $tree_column->set_sort_indicator ($setting) o $setting (boolean) sorttype = $tree_column->get_sort_order $tree_column->set_sort_order ($order) o $order (Gtk2::SortType) integer = $tree_column->get_spacing $tree_column->set_spacing ($spacing) o $spacing (integer) string = $tree_column->get_title $tree_column->set_title ($title) o $title (string) widget or undef = $tree_column->get_tree_view Since: gtk+ 2.12 boolean = $tree_column->get_visible $tree_column->set_visible ($visible) o $visible (boolean) widget or undef = $tree_column->get_widget $tree_column->set_widget ($widget) o $widget (Gtk2::Widget or undef) integer = $tree_column->get_width PROPERTIES
'alignment' (Glib::Float : readable / writable / private) X Alignment of the column header text or widget 'clickable' (boolean : readable / writable / private) Whether the header can be clicked 'expand' (boolean : readable / writable / private) Column gets share of extra width allocated to the widget 'fixed-width' (integer : readable / writable / private) Current fixed width of the column 'max-width' (integer : readable / writable / private) Maximum allowed width of the column 'min-width' (integer : readable / writable / private) Minimum allowed width of the column 'reorderable' (boolean : readable / writable / private) Whether the column can be reordered around the headers 'resizable' (boolean : readable / writable / private) Column is user-resizable 'sizing' (Gtk2::TreeViewColumnSizing : readable / writable / private) Resize mode of the column 'sort-column-id' (integer : readable / writable / private) Logical sort column ID this column sorts on when selected for sorting 'sort-indicator' (boolean : readable / writable / private) Whether to show a sort indicator 'sort-order' (Gtk2::SortType : readable / writable / private) Sort direction the sort indicator should indicate 'spacing' (integer : readable / writable / private) Space which is inserted between cells 'title' (string : readable / writable / private) Title to appear in column header 'visible' (boolean : readable / writable / private) Whether to display the column 'widget' (Gtk2::Widget : readable / writable / private) Widget to put in column header button instead of column title 'width' (integer : readable / private) Current width of the column SIGNALS
clicked (Gtk2::TreeViewColumn) ENUMS AND FLAGS
enum Gtk2::SortType o 'ascending' / 'GTK_SORT_ASCENDING' o 'descending' / 'GTK_SORT_DESCENDING' enum Gtk2::TreeViewColumnSizing o 'grow-only' / 'GTK_TREE_VIEW_COLUMN_GROW_ONLY' o 'autosize' / 'GTK_TREE_VIEW_COLUMN_AUTOSIZE' o 'fixed' / 'GTK_TREE_VIEW_COLUMN_FIXED' SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::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::TreeViewColumn(3)
All times are GMT -4. The time now is 04:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy