Sponsored Content
Top Forums Shell Programming and Scripting Help with merge two file based on similar column content Post 302523601 by zaxxon on Thursday 19th of May 2011 06:57:49 AM
Old 05-19-2011
I changed the order of those two files ie. file 1 is f2 and file 2 is f1 in your case:
Code:
awk 'NR==FNR{_[$1]=$2; next} _[$1] {print $1,_[$1]; next} {print $1,"Undefined"}' f1 f2
A1BG All
A1BG All
A1BG All
A1CF TEMP
A1CF TEMP
BCAS Undefined
BCAS Undefined
A2LD1 STOP
A2M KEEP
A2M KEEP
HAT Undefined

This User Gave Thanks to zaxxon For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

merge rows based on a common column

Hi guys, Please guide me if you have a solution to this problem. I have tried paste -s but it's not giving the desired output. I have a file with the following content- A123 box1 B345 bat2 C431 my_id A123 service C431 box1 A123 my_id I need two different outputs- OUTPUT1 A123... (6 Replies)
Discussion started by: smriti_shridhar
6 Replies

2. Shell Programming and Scripting

Merge Two Files based on First column

Hi, I need to join two files based on first column of both files.If first column of first file matches with the first column of second file, then the lines should be merged together and go for next line to check. It is something like: File one: 110001 abc efd 110002 fgh dfg 110003 ... (10 Replies)
Discussion started by: apjneeraj
10 Replies

3. Shell Programming and Scripting

merge two two txt files into one file based on one column

Hi, I have file1.txt and file2.txt and would like to create file3.txt based on one column in UNIX Eg: file1.txt 17328756,0000786623.pdf,0000786623 20115537,0000793892.pdf,0000793892 file2.txt 12521_74_4.zip,0000786623.pdf 12521_15_5.zip,0000793892.pdf Desired Output ... (5 Replies)
Discussion started by: techmoris
5 Replies

4. Shell Programming and Scripting

Joining multiple files based on one column with different and similar values (shell or perl)

Hi, I have nine files looking similar to file1 & file2 below. File1: 1 ABCA1 1 ABCC8 1 ABR:N 1 ACACB 1 ACAP2 1 ACOT1 1 ACSBG 1 ACTR1 1 ACTRT 1 ADAMT 1 AEN:N 1 AKAP1File2: 1 A4GAL 1 ACTBL 1 ACTL7 (4 Replies)
Discussion started by: seqbiologist
4 Replies

5. Shell Programming and Scripting

Help with replace column one content based on reference file

Input file 1 testing 10 20 1 A testing 20 40 1 3 testing 23 232 2 1 testing 10 243 2 . . Reference file 1 final 3 used . . Output file (2 Replies)
Discussion started by: perl_beginner
2 Replies

6. Shell Programming and Scripting

Help with replace column one content based on reference file

Input file 1 testing 10 20 1 A testing 20 40 1 3 testing 23 232 2 1 testing 10 243 2 . . Reference file 1 final 3 used . . Output file (1 Reply)
Discussion started by: perl_beginner
1 Replies

7. Shell Programming and Scripting

Merge two files with similar column entries

Hi , I have few files which contains user name and data transfer rate in MBs and this data is collected for year and for each month report is saved in 12 different files I have to merge all the files to prepare the final report Files are as below Similarly I have 10 more files ... (5 Replies)
Discussion started by: pratapsingh
5 Replies

8. UNIX for Dummies Questions & Answers

Find the average based on similar names in the first column

I have a table, say this: name1 num1 num2 num3 num4 name2 num5 num6 num7 num8 name3 num1 num3 num4 num9 name2 num8 num9 num1 num2 name2 num4 num5 num6 num4 name4 num4 num5 num7 num8 name5 num1 num3 num9 num7 name5 num6 num8 num3 num4 I want a code that will sort my data according... (4 Replies)
Discussion started by: FelipeAd
4 Replies

9. Shell Programming and Scripting

Merge files based on the column value

Hi Friends, I have a file file1.txt 1|ABC|3|jul|dhj 2|NHU|4|kil|eu 3|hjd|34|hfd|43 file2.txt 1||3|KING|dhj 2|NHU||k| 3|hjd|34|hd|43 i want to merge file1.txt file2.txt based on the column null values in file2.txif there are any nulls in column values , (5 Replies)
Discussion started by: i150371485
5 Replies

10. UNIX for Dummies Questions & Answers

How to merge two tables based on a matched column?

Hi, Please excuse me , i have searched unix forum, i am unable to find what i expect , my query is , i have 2 files of same structure and having 1 similar field/column , i need to merge 2 tables/files based on the one matched field/column (that is field 1), file 1:... (5 Replies)
Discussion started by: karthikram
5 Replies
GLXGETFBCONFIGATTRIB(3G)					   OpenGL Manual					  GLXGETFBCONFIGATTRIB(3G)

NAME
glXGetFBConfigAttrib - return information about a GLX frame buffer configuration C SPECIFICATION
int glXGetFBConfigAttrib(Display * dpy, GLXFBConfig config, int attribute, int * value); PARAMETERS
dpy Specifies the connection to the X server. config Specifies the GLX frame buffer configuration to be queried. attribute Specifies the attribute to be returned. value Returns the requested value. DESCRIPTION
glXGetFBConfigAttrib sets value to the attribute value of GLX drawables created with respect to config. glXGetFBConfigAttrib returns an error code if it fails for any reason. Otherwise, Success is returned. attribute is one of the following: GLX_FBCONFIG_ID XID of the given GLXFBConfig. GLX_BUFFER_SIZE Number of bits per color buffer. If the frame buffer configuration supports RGBA contexts, then GLX_BUFFER_SIZE is the sum of GLX_RED_SIZE, GLX_GREEN_SIZE, GLX_BLUE_SIZE, and GLX_ALPHA_SIZE. If the frame buffer configuration supports only color index contexts, GLX_BUFFER_SIZE is the size of the color indexes. GLX_LEVEL Frame buffer level of the configuration. Level zero is the default frame buffer. Positive levels correspond to frame buffers that overlay the default buffer, and negative levels correspond to frame buffers that underlie the default buffer. GLX_DOUBLEBUFFER True if color buffers exist in front/back pairs that can be swapped, False otherwise. GLX_STEREO True if color buffers exist in left/right pairs, False otherwise. GLX_AUX_BUFFERS Number of auxiliary color buffers that are available. Zero indicates that no auxiliary color buffers exist. GLX_RED_SIZE Number of bits of red stored in each color buffer. Undefined if RGBA contexts are not supported by the frame buffer configuration. GLX_GREEN_SIZE Number of bits of green stored in each color buffer. Undefined if RGBA contexts are not supported by the frame buffer configuration. GLX_BLUE_SIZE Number of bits of blue stored in each color buffer. Undefined if RGBA contexts are not supported by the frame buffer configuration. GLX_ALPHA_SIZE Number of bits of alpha stored in each color buffer. Undefined if RGBA contexts are not supported by the frame buffer configuration. GLX_DEPTH_SIZE Number of bits in the depth buffer. GLX_STENCIL_SIZE Number of bits in the stencil buffer. GLX_ACCUM_RED_SIZE Number of bits of red stored in the accumulation buffer. GLX_ACCUM_GREEN_SIZE Number of bits of green stored in the accumulation buffer. GLX_ACCUM_BLUE_SIZE Number of bits of blue stored in the accumulation buffer. GLX_ACCUM_ALPHA_SIZE Number of bits of alpha stored in the accumulation buffer. GLX_RENDER_TYPE Mask indicating what type of GLX contexts can be made current to the frame buffer configuration. Valid bits are GLX_RGBA_BIT and GLX_COLOR_INDEX_BIT. GLX_DRAWABLE_TYPE Mask indicating what drawable types the frame buffer configuration supports. Valid bits are GLX_WINDOW_BIT, GLX_PIXMAP_BIT, and GLX_PBUFFER_BIT. GLX_X_RENDERABLE True if drawables created with the frame buffer configuration can be rendered to by X. GLX_VISUAL_ID XID of the corresponding visual, or zero if there is no associated visual (i.e., if GLX_X_RENDERABLE is False or GLX_DRAWABLE_TYPE does not have the GLX_WINDOW_BIT bit set). GLX_X_VISUAL_TYPE Visual type of associated visual. The returned value will be one of: GLX_TRUE_COLOR, GLX_DIRECT_COLOR, GLX_PSEUDO_COLOR, GLX_STATIC_COLOR, GLX_GRAY_SCALE, GLX_STATIC_GRAY, or GLX_NONE, if there is no associated visual (i.e., if GLX_X_RENDERABLE is False or GLX_DRAWABLE_TYPE does not have the GLX_WINDOW_BIT bit set). GLX_CONFIG_CAVEAT One of GLX_NONE, GLX_SLOW_CONFIG, or GLX_NON_CONFORMANT_CONFIG, indicating that the frame buffer configuration has no caveats, some aspect of the frame buffer configuration runs slower than other frame buffer configurations, or some aspect of the frame buffer configuration is nonconformant, respectively. GLX_TRANSPARENT_TYPE One of GLX_NONE, GLX_TRANSPARENT_RGB, GLX_TRANSPARENT_INDEX, indicating that the frame buffer configuration is opaque, is transparent for particular values of red, green, and blue, or is transparent for particular index values, respectively. GLX_TRANSPARENT_INDEX_VALUE Integer value between 0 and the maximum frame buffer value for indices, indicating the transparent index value for the frame buffer configuration. Undefined if GLX_TRANSPARENT_TYPE is not GLX_TRANSPARENT_INDEX. GLX_TRANSPARENT_RED_VALUE Integer value between 0 and the maximum frame buffer value for red, indicating the transparent red value for the frame buffer configuration. Undefined if GLX_TRANSPARENT_TYPE is not GLX_TRANSPARENT_RGB. GLX_TRANSPARENT_GREEN_VALUE Integer value between 0 and the maximum frame buffer value for green, indicating the transparent green value for the frame buffer configuration. Undefined if GLX_TRANSPARENT_TYPE is not GLX_TRANSPARENT_RGB. GLX_TRANSPARENT_BLUE_VALUE Integer value between 0 and the maximum frame buffer value for blue, indicating the transparent blue value for the frame buffer configuration. Undefined if GLX_TRANSPARENT_TYPE is not GLX_TRANSPARENT_RGB. GLX_TRANSPARENT_ALPHA_VALUE Integer value between 0 and the maximum frame buffer value for alpha, indicating the transparent blue value for the frame buffer configuration. Undefined if GLX_TRANSPARENT_TYPE is not GLX_TRANSPARENT_RGB. GLX_MAX_PBUFFER_WIDTH The maximum width that can be specified to glXCreatePbuffer(). GLX_MAX_PBUFFER_HEIGHT The maximum height that can be specified to glXCreatePbuffer(). GLX_MAX_PBUFFER_PIXELS The maximum number of pixels (width times height) for a pixel buffer. Note that this value may be less than GLX_MAX_PBUFFER_WIDTH times GLX_MAX_PBUFFER_HEIGHT. Also, this value is static and assumes that no other pixel buffers or X resources are contending for the frame buffer memory. As a result, it may not be possible to allocate a pixel buffer of the size given by GLX_MAX_PBUFFER_PIXELS. Applications should choose the frame buffer configuration that most closely meets their requirements. Creating windows, GLX pixmaps, or GLX pixel buffers with unnecessary buffers can result in reduced rendering performance as well as poor resource allocation. NOTES
glXGetFBConfigAttrib is available only if the GLX version is 1.3 or greater. If the GLX version is 1.1 or 1.0, the GL version must be 1.0. If the GLX version is 1.2, then the GL version must be 1.1. If the GLX version is 1.3, then the GL version must be 1.2. ERRORS
GLX_NO_EXTENSION is returned if dpy does not support the GLX extension. GLX_BAD_ATTRIBUTE is returned if attribute is not a valid GLX attribute. SEE ALSO
glXGetFBConfigs(), glXChooseFBConfig(), glXGetVisualFromFBConfig(), glXGetConfig() COPYRIGHT
Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/. AUTHORS
opengl.org opengl.org 06/10/2014 GLXGETFBCONFIGATTRIB(3G)
All times are GMT -4. The time now is 09:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy