Sponsored Content
Top Forums Shell Programming and Scripting Paste files of varying lengths Post 302890553 by Un1xNewb1e on Thursday 27th of February 2014 11:39:29 AM
Old 02-27-2014
Paste files of varying lengths

I have three files of varying lengths and different number of columns. How can I paste all three with all columns aligned?

File1
----
Code:
123

File2
----
Code:
234
345
678

File3
----
Code:
456
789

Output should look like:
Code:
123	234	456
	345	789
	678

Using paste messes up the formatting and gives output as:

Code:
123  234  456
345  789
678

Please advise. Thanks

-Vin

Last edited by Don Cragun; 02-27-2014 at 02:26 PM.. Reason: Add CODE tags for all sample input and output segments.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

deleting a varying amount of lines from a list of files

I did search the posts for info on this and while there were some in the ballpark, none addressed this specifically. (also I tried to post this once it said I was logged out, so hopefully I'm not sending a duplicate here). I have a set of files (250 +/-) where I need to delete the first "$x"... (4 Replies)
Discussion started by: benair
4 Replies

2. Shell Programming and Scripting

Need a Help with paste 2 files since the output is not what i want

Need a Help with paste 2 files since the output is not what i want ie: i have 2 files pwd /home/pavargaz/alejo/scan01/nokia/2006/abril/bavaria/chu0 $ cat filechu chu0 dia Cantidad 01 257 02 262 03 260 04 58 $pwd ... (3 Replies)
Discussion started by: alexcol
3 Replies

3. UNIX for Dummies Questions & Answers

paste 2 files ( it is possible???)

Hello all, I have two files: file1: data1 data2 data3 data4 data5 data6 data7 data8 data9 file2: reference I need to paste both files with the following output: data1 data2 data3 reference data4 data5 data6 reference data7 data8 data9 reference I tried using the paste... (3 Replies)
Discussion started by: mig28mx
3 Replies

4. Shell Programming and Scripting

paste several files

Hi everybody: I tried to paste several files which have the same pattern name file like this: down_s1.dat, down_s2.dat, down_s3.dat, down_s4.dat ... down_s10.dat So I have tried to do it as: paste down_s.dat > final.dat But it does not work correctly. Any suggestion. Thanks in... (1 Reply)
Discussion started by: tonet
1 Replies

5. UNIX for Dummies Questions & Answers

paste more than 12 files together

Hi, 1. How can I get around the issue with pasting more than 12 files together? 2. paste file1 file2 > file3........how can I do this with awk?? Thanks! (14 Replies)
Discussion started by: bobo
14 Replies

6. Shell Programming and Scripting

Paste the files

Dear All, I have thousands of files (consists of one column each) and i need to paste all the columns in a single file as follows: I have files - file1, file2, file3, .......file2000. I need to paste all the files in a single file of separate columns as shown below: file1 file2 file3 ... (3 Replies)
Discussion started by: Fredrick
3 Replies

7. Shell Programming and Scripting

Merging data from 2 files of different lengths?

Hi all, Sorry if someone has answered something like this already, but I have a problem. I am not brilliant with "awk" but think it should be the command to use to get what I am after. I have 2 files: job-file (several hundred lines like): 1018003,LONG MU WAN,1113S 1018004,LONG MU... (4 Replies)
Discussion started by: sgb2301
4 Replies

8. Shell Programming and Scripting

paste mutiple files in a loop

file1.txt file2.txt file3.txt desired output is each file is in the same directory, hasthe same number of columns but different rows. i want to be able to paste them into one file. thanks! (5 Replies)
Discussion started by: johnkim0806
5 Replies

9. Shell Programming and Scripting

Merge two files with different lengths

Hi there, I have two very long files like: file1: two fields 1 123 1 125 1 234 2 123 2 234 2 300 2 312 3 10 3 215 4 56 ... (11 Replies)
Discussion started by: ClaraW
11 Replies

10. UNIX for Beginners Questions & Answers

How to paste multiple files in parallel?

Hi all, I am trying to paste thousands of files together into a matrix. Each file has only 1 column and all the files have the same number of rows (~27k rows). I tried paste * > output as well as some other for loops but the output only contains the columns from the 1st and last files. The... (8 Replies)
Discussion started by: notimenocall
8 Replies
GLBINDFRAGDATALOCATI(3G)					   OpenGL Manual					  GLBINDFRAGDATALOCATI(3G)

NAME
glBindFragDataLocationIndexed - bind a user-defined varying out variable to a fragment shader color number and index C SPECIFICATION
void glBindFragDataLocationIndexed(GLuint program, GLuint colorNumber, GLuint index, const char *name); PARAMETERS
program The name of the program containing varying out variable whose binding to modify colorNumber The color number to bind the user-defined varying out variable to index The index of the color input to bind the user-defined varying out variable to name The name of the user-defined varying out variable whose binding to modify DESCRIPTION
glBindFragDataLocationIndexed specifies that the varying out variable name in program should be bound to fragment color colorNumber when the program is next linked. index may be zero or one to specify that the color be used as either the first or second color input to the blend equation, respectively. The bindings specified by glBindFragDataLocationIndexed have no effect until program is next linked. Bindings may be specified at any time after program has been created. Specifically, they may be specified before shader objects are attached to the program. Therefore, any name may be specified in name, including a name that is never used as a varying out variable in any fragment shader object. Names beginning with gl_ are reserved by the GL. If name was bound previously, its assigned binding is replaced with colorNumber and index. name must be a null-terminated string. index must be less than or equal to one, and colorNumber must be less than the value of GL_MAX_DRAW_BUFFERS if index is zero, and less than the value of GL_MAX_DUAL_SOURCE_DRAW_BUFFERS if index is greater than or equal to one. In addition to the errors generated by glBindFragDataLocationIndexed, the program program will fail to link if: o The number of active outputs is greater than the value GL_MAX_DRAW_BUFFERS. o More than one varying out variable is bound to the same color number. NOTES
Varying out varyings may have locations assigned explicitly in the shader text using a location layout qualifier. If a shader statically assigns a location to a varying out variable in the shader text, that location is used and any location assigned with glBindFragDataLocation is ignored. ERRORS
GL_INVALID_VALUE is generated if colorNumber is greater than or equal to GL_MAX_DRAW_BUFFERS. GL_INVALID_VALUE is generated if colorNumber is greater than or equal to GL_MAX_DUAL_SOURCE_DRAW_BUFERS and index is greater than or equal to one. GL_INVALID_VALUE is generated if index is greater than one. GL_INVALID_OPERATION is generated if name starts with the reserved gl_ prefix. GL_INVALID_OPERATION is generated if program is not the name of a program object. ASSOCIATED GETS
glGetFragDataLocation() with a valid program object and the the name of a user-defined varying out variable glGetFragDataIndex() with a valid program object and the the name of a user-defined varying out variable SEE ALSO
glCreateProgram(), glLinkProgram()glGetFragDataLocation(), glGetFragDataIndex()glBindFragDataLocation() COPYRIGHT
Copyright (C) 2010 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. AUTHORS
opengl.org opengl.org 06/10/2014 GLBINDFRAGDATALOCATI(3G)
All times are GMT -4. The time now is 07:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy