Sponsored Content
Top Forums Shell Programming and Scripting Get value of last row and 6 column from awk Post 302212813 by wakhan on Tuesday 8th of July 2008 11:50:49 AM
Old 07-08-2008
Get value of last row and 6 column from awk

I want to get value of last row and 6 column from awk. Below is the format of my file. And RED one is my desired value. Actaully this stats usally update after every 1 hour so i want that every time i run the script i get the latest value.

Ending time - 01:00:58
HOURLY CALL ATTEMPTS (NORMALIZED) = 58227
Ending time - 02:00:59
HOURLY CALL ATTEMPTS (NORMALIZED) = 39987
Ending time - 03:00:58
HOURLY CALL ATTEMPTS (NORMALIZED) = 20922
Ending time - 04:00:56
HOURLY CALL ATTEMPTS (NORMALIZED) = 11385
Ending time - 05:00:57
HOURLY CALL ATTEMPTS (NORMALIZED) = 6441
Ending time - 06:00:56
HOURLY CALL ATTEMPTS (NORMALIZED) = 6598
Ending time - 07:00:59
HOURLY CALL ATTEMPTS (NORMALIZED) = 14472
Ending time - 08:00:59
HOURLY CALL ATTEMPTS (NORMALIZED) = 30849
Ending time - 09:00:58
HOURLY CALL ATTEMPTS (NORMALIZED) = 59088
Ending time - 10:00:58
HOURLY CALL ATTEMPTS (NORMALIZED) = 99476

When i use this command
Code:
more filename | awk '{print $6 }'

so it gives me the 6th column of all file but what i exactly want is last line and 6th column.

I hope, you understand.

lease HELP....

Regards,
Waqas Ahmed

Last edited by wakhan; 07-08-2008 at 12:59 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk question row into column

I have a csv file: test1.csv with 26 columns Sample: Data collected Comp1,,,,,,,,,,,,,,,,,,,,,,,,,Average Number of Arrivals with non Zero,0,0,0,0,0,0,0,0,0,...,0 %Utilization,0.1,0.23,0.14,...,0.36 Data collected Comp2,,,,,,,,,,,,,,,,,,,,,,,,,Average Number of Arrivals with non... (2 Replies)
Discussion started by: calitiggr
2 Replies

2. Shell Programming and Scripting

awk-gsub on column-wise on each row

awk '{ gsub(/....=/,""); print }' want.dat >final.dat the above awk command which removes all the chars before and including '=' on the entire row. --thats what it meant be.:) but i need to remove text on column-wise on each row. many thanks, EM ---------- Post updated at 10:00 AM... (4 Replies)
Discussion started by: elamurugu
4 Replies

3. Shell Programming and Scripting

awk: Transpose csv row to column.

Hello, am I new to awk, and I am tryint to: INPUT FILE: "73423555","73423556","73423557","73423558","73423559" OUTPUT FILE: 73423555 73423556 73423557 73423558 73423559 My useless code so far: #!/bin/awk -F ',' BEGIN { i=0; } (8 Replies)
Discussion started by: drbiloukos
8 Replies

4. UNIX for Dummies Questions & Answers

awk: convert column to row in a specific way

Hi all! I have this kind of output: a1|b1|c1|d1|e1 a2|b2|c2 a3|b3|c3|d3 I would like to transpose columns d and e (when they exist) in column c, and under the row where they come from. Then copying the beginning of the row. In order to obtain: a1|b1|c1 a1|b1|d1 a1|b1|e1 a2|b2|c2... (1 Reply)
Discussion started by: lucasvs
1 Replies

5. Shell Programming and Scripting

Subtracting each row from the first row in a single column file using awk

Hi Friends, I have a single column data like below. 1 2 3 4 5 I need the output like below. 0 1 2 3 4 where each row (including first row) subtracting from first row and the result should print below like the way shown in output file. Thanks Sid (11 Replies)
Discussion started by: ks_reddy
11 Replies

6. Shell Programming and Scripting

awk transpose row into 2 field column

Need to transpose every 2 fields of a row into a single 2 field column. input 4 135 114 76 217 30 346 110 5 185 115 45 218 85 347 125 6 85 116 130 220 65 352 95 11 30 117 55 221 42 355 75 16 72 118 55 224 37 357 430 17 30 119 55 225 40 358 62 21 52 120 65 232 480 360 180 ....... (8 Replies)
Discussion started by: sdf
8 Replies

7. UNIX for Dummies Questions & Answers

awk to print first row with forth column and last row with fifth column in each file

file with this content awk 'NR==1 {print $4} && NR==2 {print $5}' file The error is shown with syntax error; what can be done (4 Replies)
Discussion started by: cdfd123
4 Replies

8. Shell Programming and Scripting

Transpose column to row - awk

Hi there, I have a small csv file example below: source,cu_001,cu_001_volume,cu_001_mass,cu_002,cu_002_volume,cu_002_mass,cu_003,cu_003_volume,cu_003_mass ja116,1.33,3024000,9374400,1.54,3026200,9375123,1.98,3028000,9385512 I want to transpose columns to rows starting at the second... (3 Replies)
Discussion started by: theflamingmoe
3 Replies

9. Shell Programming and Scripting

awk script row to column

Hi.. I have data : Report testing1 20180419 08:00 Report testing2 20180419 07:35 Report testing 20180419 08:01 Source = data1 Report testing4 20180419 08:05 Source = data1 Report testing5 20180419 08:10 Source = data2 Report testing6 20180419 08:01 Report testing7 20180419 08:19... (4 Replies)
Discussion started by: buncit8
4 Replies

10. UNIX for Beginners Questions & Answers

Script to do column to row in awk

Hi , Can anyone help me suggesting - how to do the below trick with awk Input 120 130 140 210 310 410 645 729 800 Output 120 130 140 (6 Replies)
Discussion started by: Indra2011
6 Replies
MPI_Request_free(3OpenMPI)												MPI_Request_free(3OpenMPI)

NAME
MPI_Request_free - Frees a communication request object. SYNTAX
C Syntax #include <mpi.h> int MPI_Request_free(MPI_Request *request) Fortran Syntax INCLUDE 'mpif.h' MPI_REQUEST_FREE(REQUEST, IERROR) INTEGER REQUEST, IERROR C++ Syntax #include <mpi.h> void Request::Free() INPUT
/OUTPUT PARAMETER request Communication request (handle). DESCRIPTION
This operation allows a request object to be deallocated without waiting for the associated communication to complete. MPI_Request_free marks the request object for deallocation and sets request to MPI_REQUEST_NULL. Any ongoing communication that is associ- ated with the request will be allowed to complete. The request will be deallocated only after its completion. NOTES
Once a request is freed by a call to MPI_Request_free, it is not possible to check for the successful completion of the associated communi- cation with calls to MPI_Wait or MPI_Test. Also, if an error occurs subsequently during the communication, an error code cannot be returned to the user -- such an error must be treated as fatal. Questions arise as to how one knows when the operations have completed when using MPI_Request_free. Depending on the program logic, there may be other ways in which the program knows that certain operations have completed and this makes usage of MPI_Request_free practical. For example, an active send request could be freed when the logic of the program is such that the receiver sends a reply to the message sent -- the arrival of the reply informs the sender that the send has completed and the send buffer can be reused. An active receive request should never be freed, as the receiver will have no way to verify that the receive has completed and the receive buffer can be reused. Example: CALL MPI_COMM_RANK(MPI_COMM_WORLD, rank) IF(rank.EQ.0) THEN DO i=1, n CALL MPI_ISEND(outval, 1, MPI_REAL, 1, 0, req, ierr) CALL MPI_REQUEST_FREE(req, ierr) CALL MPI_IRECV(inval, 1, MPI_REAL, 1, 0, req, ierr) CALL MPI_WAIT(req, status, ierr) END DO ELSE ! rank.EQ.1 CALL MPI_IRECV(inval, 1, MPI_REAL, 0, 0, req, ierr) CALL MPI_WAIT(req, status) DO I=1, n-1 CALL MPI_ISEND(outval, 1, MPI_REAL, 0, 0, req, ierr) CALL MPI_REQUEST_FREE(req, ierr) CALL MPI_IRECV(inval, 1, MPI_REAL, 0, 0, req, ierr) CALL MPI_WAIT(req, status, ierr) END DO CALL MPI_ISEND(outval, 1, MPI_REAL, 0, 0, req, ierr) CALL MPI_WAIT(req, status) END IF This routine is normally used to free persistent requests created with either MPI_Recv_init or MPI_Send_init and friends. However, it can be used to free a request created with MPI_Irecv or MPI_Isend and friends; in that case the use can not use the test/wait routines on the request. It is permitted to free an active request. However, once freed, you can not use the request in a wait or test routine (e.g., MPI_Wait ). ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ func- tions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. SEE ALSO
MPI_Isend MPI_Irecv MPI_Issend MPI_Ibsend MPI_Irsend MPI_Recv_init MPI_Send_init MPI_Ssend_init MPI_Rsend_init MPI_Test MPI_Wait MPI_Waitall MPI_Waitany MPI_Waitsome MPI_Testall MPI_Testany MPI_Testsome Open MPI 1.2 September 2006 MPI_Request_free(3OpenMPI)
All times are GMT -4. The time now is 09:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy