Sponsored Content
Top Forums UNIX for Dummies Questions & Answers awk code to process column pairs and find those with more than 1 set of possible values Post 302569888 by kasan0 on Wednesday 2nd of November 2011 01:04:15 AM
Old 11-02-2011
Thanks very much for that. I've since found out that the problem is slightly different from what I thought so I'm going to re-post. I will try your code out though as it looks like it would be helpful. Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pick values from column based on key values by usin AWK

Dear Guyz:) I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z). I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies

2. Shell Programming and Scripting

for each different entry in column 1 extract maximum values from column 2 in unix/awk

Hello, I have 2 columns (1st column has multiple entries but the corresponding values in the column 2 may be the same or different.) however I want to extract unique values for each entry in column 1 by assigning the max value from column 2 SDF4 -0.211654 SDF4 0.978068 ... (1 Reply)
Discussion started by: Diya123
1 Replies

3. Shell Programming and Scripting

Using AWK to find top Nth values in Nth column

I have an awk script to find the maximum value of the 2nd column of a 2 column datafile, but I need to find the top 5 maximum values of the 2nd column. Here is the script that works for the maximum value. awk 'BEGIN { subjectmax=$1 ; max=0} $2 >= max {subjectmax=$1 ; max=$2} END {print... (3 Replies)
Discussion started by: ncwxpanther
3 Replies

4. UNIX for Dummies Questions & Answers

Command line / script option to filter a data set by values of one column

Hi all! I have a data set in this tab separated format : Label, Value1, Value2 An instance is "data.txt" : 0 1 1 -1 2 3 0 2 2 I would like to parse this data set and generate two files, one that has only data with the label 0 and the other with label -1, so my outputs should be, for... (1 Reply)
Discussion started by: gnat01
1 Replies

5. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

6. Shell Programming and Scripting

Sum pairs of values and per level and state which one is absent

There are 3 values (cols 3,4,5) for each name (col 1) and level (col2 ). Some levels for some of the names do not exist. Files are space delimited SSGG765 L1 1 2 3 SSGG765 L2 4 5 6 GUHJHJJ7 L1 7 8 9 GUHJHJJ7 L5 10 12 13 FFRTGGG L1 11 1 3 Given a list of pairwise names, I want... (5 Replies)
Discussion started by: jalaj841
5 Replies

7. UNIX for Dummies Questions & Answers

Htop process viewer - set column width

I try to enlarge the htop column's width. I've found a solution, but it seems very specific and also too difficult. Is there any simpler way to make all the characters in a column visible? (0 Replies)
Discussion started by: plaidshirtuser
0 Replies

8. Shell Programming and Scripting

Find duplicate values in specific column and delete all the duplicate values

Dear folks I have a map file of around 54K lines and some of the values in the second column have the same value and I want to find them and delete all of the same values. I looked over duplicate commands but my case is not to keep one of the duplicate values. I want to remove all of the same... (4 Replies)
Discussion started by: sajmar
4 Replies

9. UNIX for Beginners Questions & Answers

Find unique values but only in column 1

Hi All, Does anyone have any suggestions/examples of how i could show only lines where the first field is not duplicated. If the first field is listed more than once it shouldnt be shown even if the other columns make it unique. Example file : 876,RIBDA,EC2 876,RIBDH,EX7 877,RIBDF,E28... (4 Replies)
Discussion started by: mutley2202
4 Replies

10. Shell Programming and Scripting

awk script to append suffix to column when column has duplicated values

Please help me to get required output for both scenario 1 and scenario 2 and need separate code for both scenario 1 and scenario 2 Scenario 1 i need to do below changes only when column1 is CR and column3 has duplicates rows/values. This inputfile can contain 100 of this duplicated rows of... (1 Reply)
Discussion started by: as7951
1 Replies
tixGrid(n)						       Tix Built-In Commands							tixGrid(n)

NAME
tixGrid - Create and manipulate Tix Grid widgets -background -borderWidth -cursor -font -foreground -height -highlight- Color -highlightThickness -relief -selectBackground -selectForeground -width -xScrollCommand -yScrollCommand WIDGET-SPECIFIC OPTIONS [-editdonecmd editDoneCmd] If non-empty, gives a Tcl command to be executed when the user has edited grid cell. When this command is called, it is passed with two additional parameters: x y, where (x,y) is the location of the cell that has just been edited. [-editnotify- cmd editNotifyCmd] If non-empty, gives a Tcl command to be executed when the user tries to edit a grid cell. When this command is called, it is passed with two additional parameters: x y, where (x,y,) is the location of the cell. This command should return a boolean value: true indicates that the cells is editable and false otherwise. [-formatcmd formatCmd] If non-empty, gives a Tcl command to be executed when the grid cells need to be formatted on the screen. Normally, this command calls the format widget command (see below). When this com- mand is called, it is passed with five additional parameters: type x1 y1 x2 y2. type gives the logical type of the region in the grid. It may be one of the following. x-region: the horizontal margin; y-region: the vertical margin; s-region, the area where the the horizontal and vertical margins are joined; main: all the cells that do not fall into the above three types. x1 y1 x2 y2 gives the extent of the region that needs formatting. [-leftmargin leftMargin] In the number of cells, gives the width of vertical margin. A zero indicates that no vertical should be drawn. [-selectmode selectMode] Specifies one of several styles for manipulating the selection. The value of the option may be arbitrary, but the default bindings expect it to be either single, browse, multiple, or extended; the default value is sin- gle. [-selectunit selectUnit] Specifies the selection unit. Valid values are cell, column or row. [-topmargin topMargin] In the number of cells, gives the height of horizontal margin. A zero indicates that no horizontal should be drawn. DESCRIPTION
The tixGrid command creates a new window (given by the pathName argument) and makes it into a tixGrid widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the tixGrid widget such as its cur- sor and relief. A Grid widget displays its contents in a two dimensional grid of cells. Each cell may contain one Tix display item, which may be in text, graphics or other formats. See the tixDisplayStyle manual page for more information about Tix display items. Individual cells, or groups of cells, can be formatted with a wide range of attributes, such as its color, relief and border. WIDGET COMMAND
The tixGrid command creates a new Tcl command whose name is the same as the path name of the tixGrid widget's window. This command may be used to invoke various operations on the widget. It has the following general form: pathName option ?arg arg ...? PathName is the name of the command, which is the same as the tixGrid widget's path name. Option and the args determine the exact behavior of the command. The following commands are possible for tixGrid widgets: pathName anchor option ?args ...? Manipulates the anchor cell of the tixGrid widget. The anchor cell is the end of the selection that is fixed while the user is drag- ging out a selection with the mouse. pathName bdtype TODO place holder pathName cget option Returns the current value of the configuration option given by option. Option may have any of the values accepted by the tixGrid command. pathName configure ?option? ?value option value ...? Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo(n) for information on the format of this list.) If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given wid- get option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the tixGrid command. pathName delete dim from ?to? Dim may be row or column. If to is not given, deletes a single row (or column) at the position from. If to is given, deletes the range of rows (or columns) from position from through to. pathName edit apply If any cell is being edited, de-highlight the cell and applies the changes. pathName edit set x y Highlights the cell at (x,y) for editing, if the -editnotify command returns true for this cell. pathName entrycget x y option Returns the current value of the configuration option given by option of the cell at (x,y). Option may have any of the values accepted by the set widget command. pathName entryconfigure x y ?option? ?value option value ...? Query or modify the configuration options of the cell at (x,y). If no option is specified, returns a list describing all of the available options for the cell (see Tk_ConfigureInfo(n) for information on the format of this list.) If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified.) If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the set widget command. pathName format TODO place holder pathName index TODO place holder pathName move dim from to offset Dim may be row or column. Moves the the range of rows (or columns) from position from through to by the distance indicated by off- set. For example, move row 2 4 1 moves the rows 2,3,4 to rows 3,4,5. pathName set x y ?-itemtype type? ?option value...? Creates a new display item at the cell at (x,y). The optional -itemtype parameter gives the type of the display item. An additional list of option-value pairs specify options of the display item. If a display item already exists at this cell, the old item will be deleted automatically. pathName size dim index ?option value ...? Queries or sets the size of the row or column given by dim and index. Dim may be row or column. Index may be any non-negative inte- ger that gives the position of a given row (or column). Index can also be the string default; in this case, this command queries or sets the default size of all rows (or columns). When no option-value pair is given, this command returns a list containing the current size setting of the given row (or column). When option-value pairs are given, the corresponding options of the size setting of the given row are changed. Option may be one of the foll- wing: -pad0 pixels Specifies the paddings to the left or a column or the top of a row. -pad1 pixels Specifies the paddings to the right or a column or the bottom of a row. -size val Specifies the width of a column or the height of a row. Val may be: auto -- the width of the column is set the the widest cell in the column; a valid Tk screen distance unit (see Tk_GetPixels(n)); or a real number following by the word chars (e.g. 3.4chars) that sets the width of the column to the given number of characters. pathName unset x y Clears the cell at (x,y) by removing its display item. pathName xview TODO place holder pathName yview TODO place holder KEYWORDS
grid, spread sheet, table Tix 4.1 tixGrid(n)
All times are GMT -4. The time now is 06:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy