Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to select rows that have opposite values (A vs B, or B vs A) on first two columns? Post 302995248 by nengcheng on Monday 3rd of April 2017 05:04:16 PM
Old 04-03-2017
Quote:
Originally Posted by Don Cragun
I thought the purpose of your request was to extract matched pairs of lines and that is what the code I suggested does. I don't know what:

means, or where this data came from. (It certainly is not present in the sample dataset you provided and it is not output that would be produced by the script I suggested in post #3 in this thread.)

If your requirements have changed, please start a new thread with your new problem and clearly describe the input data you are going to be processing, describe the output(s) you want to produce from that input, provide a representative sample input dataset (in CODE tags), show us the output(s) that should be produced from that sample input (in CODE tags), and show us the code that you have written to try to solve your problem (in CODE tags).
yeah, it's not the same as my sample dataset. but the format is similar and it works perfect for my dataset as I applied it into my dataset. Output is like this:
Code:
Glyma.10G001700 Glyma.10G179600 83.45 701 113 1 44 741 50 750 0.0 649
Glyma.10G179600 Glyma.10G001700 83.45 701 113 1 50 750 44 741 0.0 649
Glyma.10G056500 Glyma.10G056300 89.27 261 24 2 41 300 61 318 4e-88 324
Glyma.10G056300 Glyma.10G056500 89.27 261 24 2 61 318 41 300 5e-88 324

Thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl script to print to values in rows and columns

Hi guys I want to print the values by using this script but its giving the no of rows and columns as input instead of values Would you plz help me on this FILE- chr1.txt 1981 1 1971 1 1961 1 1941 1 perl script #!/usr/bin/perl -w $infile1 = 'chr1.txt'; $outfile3 = 'out3.txt'; ... (3 Replies)
Discussion started by: nogu0001
3 Replies

2. Programming

SQL: the opposite of "SELECT now() -interval 1 day"

Hi there, if i run SELECT now() -interval 1 day I get all items within the last 24 hours. How would I reverse/adjust this so that i get everything that ISNT in the last 24 hours ? any help on this would be greatly appreciated Cheers (1 Reply)
Discussion started by: rethink
1 Replies

3. Shell Programming and Scripting

Selecting rows based on values in columns

Hi My pipe delimited .txt file contains rows with 10 columns. Can anyone advise how I output to file only those rows with the letters ‘ci' as the first 2 characters in the 3rd column ? Many thanks (4 Replies)
Discussion started by: malts18
4 Replies

4. Shell Programming and Scripting

Extract values from a matrix given the rows and columns

Hi All, I have a huge (and its really huge!) matrix about 400GB in size (2 million rows by 1.5 million columns) . I am trying to optimize its space by creating a sparse representation of it. Miniature version of the matrix looks like this (matrix.mtx): 3.4543 65.7876 54.564 2.12344... (4 Replies)
Discussion started by: shoaibjameel123
4 Replies

5. UNIX for Dummies Questions & Answers

Extracting rows from a text file based on the values of two columns (given ranges)

Hi, I have a tab delimited text file with multiple columns. The second and third columns include numbers that have not been sorted. I want to extract rows where the second column includes a value between -0.01 and 0.01 (including both numbers) and the first third column includes a value between... (1 Reply)
Discussion started by: evelibertine
1 Replies

6. Shell Programming and Scripting

Deleting all the fields(columns) from a .csv file if all rows in that columns are blanks

Hi Friends, I have come across some files where some of the columns don not have data. Key, Data1,Data2,Data3,Data4,Data5 A,5,6,,10,, A,3,4,,3,, B,1,,4,5,, B,2,,3,4,, If we see the above data on Data5 column do not have any row got filled. So remove only that column(Here Data5) and... (4 Replies)
Discussion started by: ks_reddy
4 Replies

7. Shell Programming and Scripting

Evaluate 2 columns, add sum IF two columns match on two rows

Hi all, I know this sounds suspiciously like a homework course; but, it is not. My goal is to take a file, and match my "ID" column to the "Date" column, if those conditions are true, add the total number of minutes worked and place it in this file, while not printing the original rows that I... (6 Replies)
Discussion started by: mtucker6784
6 Replies

8. Shell Programming and Scripting

Compare 2 csv files by columns, then extract certain columns of matcing rows

Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns. I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Discussion started by: bkane3
5 Replies

9. Shell Programming and Scripting

Extract rows with different values at 2 columns

Hallo, I would need to extract only rows which has different value in the second and third column. Thank you very much for any advices Input: A 0 0 B 0 1 C 1 1 D 1 3 Output B 0 1 D 1 3 (4 Replies)
Discussion started by: kamcamonty
4 Replies

10. Shell Programming and Scripting

Help with shell script: selecting rows that have the same values in two columns

Hello, everyone I am beginner for shell programming. I want to print all lines that have the same values in first two columns data: a b 1 2 a a 3 4 b b 5 6 a b 4 6 what I expected is : a a 3 4 b b 5 6 but I searched for one hour in... (2 Replies)
Discussion started by: nengcheng
2 Replies
XWIT(1) 						      General Commands Manual							   XWIT(1)

NAME
xwit - window interface tool: pop or iconify this xterm window or named windows SYNOPSIS
xwit [-display display] [-sync] [-pop] [-focus] [-iconify] [-unmap] [-raise] [-lower] [-opposite] [-[un]circulate] [-resize w h] [-rows r] [-columns c] [-[r]move x y] [-[r]warp x y] [-colormap colormapid] [-[no]save] [-name name] [-iconname name] [-bitmap file] [-mask file] [-[r]iconmove x y] [-[no]backingstore] [-[no]saveunder] [-[no]keyrepeat keycode ... keycode - keycode ...] [-id windowid] [-root] [-current] [-select] [-all] [-names initialsubstring...] DESCRIPTION
xwit is an X window interface tool. By default when used with no arguments in an xterm it de-iconifies and raises the window. You can specify a different function to do, such as iconifying the window, and apply it to several windows whose name begins with one of the given strings, or a particular window id given, or the window id found in the environment variable WINDOWID (which is set by xterm for the pro- gram it runs), or the window under the mouse cursor. OPTIONS
-display is followed by the display to open. -sync causes all X requests to be performed synchronously. -property property causes the specified property to be used instead of the windows name (which is WM_NAME). Some possible values are: WM_CLASS, WM_COMMAND, WM_ICON_NAME, WM_CLIENT_MACHINE. -pop is the default action. It need only be given if it is wanted as well as some other function. -focus will give the input focus to the specified window. -iconify will iconify the windows instead of popping them. -unmap will iconify windows by unmapping with a non ICCCM compliant window manager. (Beware, this option is not usually what you want). -raise raise windows (but do not map them if unmapped). -lower lower windows. -opposite toggle the stacking of windows from top to bottom among any overlapping windows. -circulate circulate a window's subwindows forward. Use this with -root. -uncirculate circulate a window's subwindows backward. Use this with -root. -resize w h resize windows to the given pixel size. -rows r resize windows to the given number of rows. -columns c resize windows to the given number of columns. -move x y move windows to the given absolute position relative to its parent. (If the x or y value is negative it is taken relative to the right or bottom edge of the parent.) -rmove x y move windows by the given relative amount. -warp x y move the cursor to the given position relative to the specified window. Add -root to warp to an absolute position. -rwarp x y move the cursor by the given relative amount. -colormap colormapid install the given colormap into the given window. -save -nosave immediately enable or disable the screen saver. -name name set the WM_NAME property to the given string. -iconname name set the WM_ICON_NAME property to the given string. -bitmap file use the given bitmap file as the icon bitmap for the window. -mask file use the given bitmap file as the icon mask for the window. -iconmove x y move icons to the given absolute position. (Will not work with some window managers.) -riconmove x y move icons by the given relative amount. (Will not work with some window managers.) -backingstore -bs -nobackingstore -nobs enable or disable backing store for the window. -saveunder -su -nosaveunder -nosu enable or disable saveunders for the window. -keyrepeat -nokeyrepeat is followed by a list of keycodes (decimal numbers, see xmodmap(1)). A range can be specified as a lower number, ``-'', and upper number as three separate arguments. The individual setting of auto-repeat for those keycodes is set on or off. The global setting of auto-repeat can be set with xset(1). When off, no keys will repeat. -print will print the id, the coordinates, the depth and the name of all selected windows. If -property is given, that one will be printed instead of the name. Window Selection If no window is specified, $WINDOWID will be used if set; otherwise the window under the cursor will be selected. -id is followed by a single window number, in decimal; or, if it begins with 0x, in hexadecimal. -root selects the root window. -current selects the window under the cursor (default if no window specified and $WINDOWID not set). -select allows the user to interactively select a window with the mouse. -all is equivalent to -names '', as easier to remember. -names if given must be the last option and is followed by a list of strings. All windows that have a name that begins exactly like one of the strings will be acted upon. If -property is given, this property is used instead of the name. By using a null string (-names ''), all names will be matched. EXAMPLES
To de-iconify and pop ``this'' xterm and warp the cursor into it: xwit -pop -warp 50 50 To interactively select an xterm, and resize it to 34 rows and 80 columns: xwit -select -rows 34 -columns 80 To gently agitate your oclock on the screen: while xwit -rmove 0 10 -names oclock do xwit -rmove 0 -10 -names oclock done DIAGNOSTICS
Exit status is 0 if any action is taken, 1 if no window matches the list supplied to -names, 2 if an error occurs. LIMITATIONS
Since each application is supposed to request these functions of the window manager, some of them may not like other clients mapping and unmapping them behind their backs. Iconification is requested of the window manager using the ICCCM. Non ICCCM compliant window managers may not react correctly. AUTHORS
Mark M Martin, CETIA France, mmm@cetia.fr David DiGiacomo, david@slack.com ACKNOWLEDGEMENTS
Thanks to Andre Delafontaine, Norman R. McBride, Keith Thompson, Glen R. Walker, Michael Mauch, Dima Barsky and Decklin Foster for bug reports, suggestions and/or patches. 2 Dec 2005 XWIT(1)
All times are GMT -4. The time now is 06:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy