Sponsored Content
Top Forums Shell Programming and Scripting Format data by consolidating replicated obs Post 302936857 by jianp83 on Saturday 28th of February 2015 02:31:56 PM
Old 02-28-2015
thank you, but the issue is you have fixed the reads, as I had mentioned it is quite variable (sometimes ranging upto 70), , can we modify this script to accommodate those types of conditions?

I tried this for the first part, would you please have a look and correct the syntax?
Code:
        awk     'NR==1          { for (i=(NF-2);i<=NF;i++)
        				
        			  j++ ;
        			   read[j]=$i;

	                        }
	              NR>1          { for (i=1;i<=j;i++)
	                        { print $1, read[j]"_"$2, $(NF-j) }

	                        }
        ' FS="\t" OFS="\t" file2


Last edited by jianp83; 03-01-2015 at 12:15 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding values then consolidating lines

I'm a begginer with scripting... Have a script that pulls check information data. There are multiple lines for each check. ALL the info is the same on the line EXCEPT the charges. ie: same check number, same payee, same patient, same check date, DIFFERENT CHARGE. I need to total the charges... (0 Replies)
Discussion started by: tdavenpo
0 Replies

2. UNIX for Advanced & Expert Users

Consolidating Pipes

This is something I've given a lot of thought to and come up with no answer. Say you have a data stream passing from a file, through process A, into process B. Process A only modifies a few bytes of the stream, then prints the rest of the stream unmodified. Is there any way to stream the file... (4 Replies)
Discussion started by: Corona688
4 Replies

3. UNIX for Dummies Questions & Answers

converting a tabular format data to comma seperated data in KSH

Hi, Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent. E.g : username empid ------------------------ sri 123 to username,empid sri,123 Thanks, Hema:confused: (2 Replies)
Discussion started by: Hemamalini
2 Replies

4. Shell Programming and Scripting

How to replicated records using sed

I need to generate exactly 102 duplicates in a file using sed. Here's an example of my input: Grid-ref = 1, 148 Grid-ref = 1, 311 Grid-ref = 1, 428 I need: Grid-ref = 1, 148 Grid-ref = 1, 148 Grid-ref = 1, 148 Grid-ref = 1, 148 ... repeated 102 times, then Grid-ref = 1, 311... (2 Replies)
Discussion started by: Russ
2 Replies

5. Windows & DOS: Issues & Discussions

Consolidating Freespace to allow shrinking partition?

i have an "old" laptop with 84gb used space, 203gb free, running 32bit Windows Vista. i've tried all defragmenting programs i could find and though some offer Free Space Defrag, they don't seem to take into account where on the disk to consolidates the space to. what i am trying to achieve is... (4 Replies)
Discussion started by: Sterist
4 Replies

6. Shell Programming and Scripting

Preventing script from being replicated on a defined number of hosts

ok. i have an extensive program written predominantly in borne shell. i have to give an "evaluation" copy of this program to a user so she can test it out and see if she wants it. problem is, i dont have an evaluation copy. and even if i did, im worried the evaluation copy can be edited to... (8 Replies)
Discussion started by: SkySmart
8 Replies

7. Solaris

Working with disk sets from replicated LUNs

Hi everybody We have a Sun Cluster with two nodes, connected to a number of SAN disks over fiber cables. We made SVM disk sets on those disks for our application needs. Now we constructed another site in another metropolitan area, but with only one node (no cluster), and connected it to the main... (2 Replies)
Discussion started by: abohmeed
2 Replies

8. Shell Programming and Scripting

Help with consolidating mails sent by executing script

I have a script which checks for swap usage of the unix server. A cron job has been created to execute this script every hour and send the output via mail. This output is only required for a particular duration and it can range anywhere from 6 hours to 10 hours. So we are commenting out the... (1 Reply)
Discussion started by: kiran1112
1 Replies

9. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

10. Shell Programming and Scripting

Consolidating multiple outputs in one file

Dears, i am stuck here i have 3 scripts running at one time and all the three scripts finish at different time and each script generate 1 file with different name. so i will have three files. i dnt know which script finish first i want to have a script which check if all the there files are... (6 Replies)
Discussion started by: mirwasim
6 Replies
GLCLEARBUFFERSUBDATA(3G)					   OpenGL Manual					  GLCLEARBUFFERSUBDATA(3G)

NAME
glClearBufferSubData - fill all or part of buffer object's data store with a fixed value C SPECIFICATION
void glClearBufferSubData(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void * data); PARAMETERS
target Specify the target of the operation. target must be one of the global buffer binding targets. internalformat The internal format with which the data will be stored in the buffer object. offset The offset, in basic machine units into the buffer object's data store at which to start filling. size The size, in basic machine units of the range of the data store to fill. format The format of the data in memory addressed by data. type The type of the data in memory addressed by data. data The address of a memory location storing the data to be replicated into the buffer's data store. DESCRIPTION
glClearBufferSubData fills a specified region of a buffer object's data store with data from client memory. offset and size demark the extent of the region within the data store of the buffer object bound to target to fill with data. Data, initially supplied in a format specified by format in data type type is read from the memory address given by data and converted into the internal representation given by internalforamt. This converted data is then replicated throughout the specified region of the buffer object's data store. If data is NULL, then the subrange of the buffer's data store is filled with zeros. ERRORS
GL_INVALID_ENUM is generated if target not one of the generic buffer binding targets. GL_INVALID_VALUE is generated if no buffer is bound to target. GL_INVALID_ENUM is generated if internalformat is not a sized internal format. GL_INVALID_VALUE is generated if offset or range are not multiples of the number of basic machine units per-element for the internal format specified by internalformat. GL_INVALID_VALUE is generated if offset or size is less than zero, or if offset + size is greater than the value of GL_BUFFER_SIZE for the buffer bound to target. GL_INVALID_OPERATION is generated if any part of the specified buffer range is mapped with glMapBufferRange() or glMapBuffer(). SEE ALSO
glClearBufferData(). COPYRIGHT
Copyright (C) 2012 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 GLCLEARBUFFERSUBDATA(3G)
All times are GMT -4. The time now is 12:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy