This one relies on the empty line block separator trailing the P1 blocks:
Thanks Rudic. It works. Can you explain a little about your awk line. Does it work block by block or line by line ?
Sorry for asking such a basic question but I am very new to awk.
Last edited by garvit184; 06-23-2014 at 08:15 AM..
Dear all,
I am using awk in a bash script to extract a list of x y z coordinates from a file such as:
%BEGIN 3D-SPACE COORDINATES
0.2085627338147950 0.2471306816410478 0.2085627338147950
0.1242549179185660 0.2755539793525220 0.4147884486606120
0.2030669560265720 ... (6 Replies)
I have two text files where the first three columns are exactly the same. I want to compare the fourth column of the text files and if the values are different, print that row into a new output file. How do I go about doing that?
File 1:
100 rs3794811 0.01 0.3434
100 rs8066551 0.01... (8 Replies)
I have a C++ program. I read command line arguments, but if the value is not supplied, I default or make a calculation. Let's say I set it to a default value.
I can code this in several ways. Here I show three ways. What would be the best way for maintaining this code? The program will get very... (2 Replies)
I am trying to delete lines in archived Apache httpd logs
Each line has the pattern:
<ip-address> - - <date-time> <document-request-URL> <http-response> <size-of-req'd-doc> <referring-document-URL>
This pattern is shown in the example of 6 lines from the log in the code box below. These 6... (1 Reply)
Hi,
I have two text files with matching first columns. Some of the values in the second column do not match. I want to write a script to print out the rows (only the first column) where the values in the second column do not match.
Example:
Input 1
A 1
B 2
C 3
D 4
Input 2
A 2
B 2... (6 Replies)
Hi All
I had requirement where I need to re-order columns in a file by using a control file.
here is the ctrl file
c1
c2
c3
source file
c3 | c1 | c2
a | b| c
I should create output file based on the ctrl file columns
o/p should look like this
c1 | c2 | c3
b| c|a
I wrote some... (9 Replies)
First I'd like to apologize if I opened a thread which is already open somewhere.
I did a bit of searching but could quite find what I was looking for, so I will try to explaing what I need.
I'm writing a script on our server, got to a point where I have two files with results. Example:
File1... (6 Replies)
My file (the output of an experiment) starts off looking like this,
_____________________________________________________________
Subjects incorporated to date: 001
Data file started on machine PKSHS260-05CP
**********************************************************************
Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
LEARN ABOUT SUNOS
dat_strerror
dat_strerror(3DAT) Direct Access Transport Library Functions dat_strerror(3DAT)NAME
dat_strerror - convert a DAT return code into human readable strings
SYNOPSIS
cc [ flag... ] file... -ldat [ library... ]
#include <dat/udat.h>
DAT_RETURN
dat_strerror(
IN DAT_RETURN return,
OUT const char **major_message,
OUT const char **minor_message
)
PARAMETERS
return DAT function return value.
message A pointer to a character string for the return.
DESCRIPTION
The dat_strerror() function converts a DAT return code into human readable strings. The major_message is a string-converted DAT_TYPE_STA-
TUS, while minor_message is a string-converted DAT_SUBTYPE_STATUS. If the return of this function is not DAT_SUCCESS, the values of
major_message and minor_message are not defined.
If an undefined DAT_RETURN value was passed as the return parameter, the operation fails with DAT_INVALID_PARAMETER returned. The operation
succeeds when DAT_SUCCESS is passed in as the return parameter.
RETURN VALUES
DAT_SUCCESS The operation was successful.
DAT_INVALID_PARAMETER Invalid parameter. The return value is invalid.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard: uDAPL, 1.1, 1.2 |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO libdat(3LIB), attributes(5)SunOS 5.10 16 Jul 2004 dat_strerror(3DAT)