Hi,
I want to know if you can input with sed but instead of specifing a line number like below I wan't to be able to insert based on a specific word or patttern.
10i\
Insert me after line 10
is this possible with sed or should I use AWK?
Thanks
Jack (2 Replies)
I am really need help with the regular expression in SED. From input file, I need to extract lines that have the port number (sport or dport) as defined. The input file is something like this
time=1209515280-1209515340 dst=192.168.133.202 src=208.70.8.23 bytes=2472 proto=6 sport=80 dport=1447... (6 Replies)
Hi,
If there exist multiple pattern in a file, how can I find the last record matching the pattern through perl.
The below script searches for the pattern everywhere in an input file.
#! /usr/bin/perl -s -wnl
BEGIN {
$pattern or
warn"Usage: $0 -pattern='RE' \n" and
exit 255;... (5 Replies)
I am working on a scraping project and I am stuck at this tiny grep pattern match.
Sample text :
FPA List. FPA List. FPA List. FPA List. FPA List. FPA List. FPA List. FPA List.
ABC Personal Planning
Catherine K. Wat
Cath Wat
Catherine K. Wat
Catherine K. Wat
IFRAME:... (8 Replies)
Hi all,
I have a text data file. My aim here is to find line called *FIELD* AV for every record and print lines after that till *FIELD* RF. But here I want first 3 to four lines for very record as well. FIELD AV is some where in between for very record. SO I am not sure how to retrieve lines in... (2 Replies)
Hi,
I need some help on how to print the whole data for unmatched pattern. i have 2 different files that need to be checked and print out the unmatched patterns into a new file. My sample data as follows:-
File1.txt
Id Num Activity Class Type
309 1.1 ... (5 Replies)
Hi,
I have script like below:
#!/usr/local/bin/perl
use strict;
use warnings;
while (<DATA>) {
( my ($s_id) = /^\d+\|(\d+?)\|/ ) ;
if ( $s_id == 1 ){
s/^(.*\|)*.*ABC\.pi=(+|+)*.*ABC\.id=(\d+|+).*$/$1$2|$3/s;
print "$1$2|$3\n"; (2 Replies)
Hello Friends,
I need to print lines in between two string when a keyword existed in those lines (keywords like exception, error, failed, not started etc).
for example,
input:
..
Begin Edr
ab12
ac13
ad14
bc23
exception occured
bd24
cd34
dd44
ee55
ff66
End Edr (2 Replies)
Hi experts,
I have a file with regexes which is used for automatic searches on several files (40+ GB).
To do some postprocessing with the grep result I need the matching line as well as the match itself.
I know that the latter could be achieved with grep's -o option. But I'm not aware of a... (2 Replies)
Hi I want to print the line until pattern is matched.
I am using below code:
sed -n '1,/pattern / p' file
It is working fine for me , but its not working for exact match.
sed -n '1,/^LAC$/ p' file
Input:
LACC FEGHRA 0
LACC FACAF 0
LACC DARA 0
LACC TALAC 0
LAC ILACTC 0... (8 Replies)
Discussion started by: Abhisrajput
8 Replies
LEARN ABOUT OSX
glevalmesh
GLEVALMESH(3G)GLEVALMESH(3G)NAME
glEvalMesh1, glEvalMesh2 - compute a one- or two-dimensional grid of points or lines
C SPECIFICATION
void glEvalMesh1( GLenum mode,
GLint i1,
GLint i2 )
PARAMETERS
mode In glEvalMesh1, specifies whether to compute a one-dimensional mesh of points or lines. Symbolic constants GL_POINT and GL_LINE are
accepted.
i1, i2
Specify the first and last integer values for grid domain variable i.
C SPECIFICATION
void glEvalMesh2( GLenum mode,
GLint i1,
GLint i2,
GLint j1,
GLint j2 )
PARAMETERS
mode In glEvalMesh2, specifies whether to compute a two-dimensional mesh of points, lines, or polygons. Symbolic constants GL_POINT,
GL_LINE, and GL_FILL are accepted.
i1, i2 Specify the first and last integer values for grid domain variable i.
j1, j2 Specify the first and last integer values for grid domain variable j.
DESCRIPTION
glMapGrid and glEvalMesh are used in tandem to efficiently generate and evaluate a series of evenly-spaced map domain values. glEvalMesh
steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1
and glMap2. mode determines whether the resulting vertices are connected as points, lines, or filled polygons.
In the one-dimensional case, glEvalMesh1, the mesh is generated as if the following code fragment were executed:
glBegin( type );
for ( i = i1; i <= i2; i += 1 )
glEvalCoord1( i dot DELTA u + u1 );
glEnd();
where
DELTA(u) = (u2 - u1 ) / n
and n, u1, and u2 are the arguments to the most recent glMapGrid1 command. type is GL_POINTS if mode is GL_POINT, or GL_LINES if mode is
GL_LINE.
The one absolute numeric requirement is that if i = n, then the value computed from i dot DELTA(u) + u1 is exactly u2.
In the two-dimensional case, glEvalMesh2, let
DELTA(u) = ( u2 - u1 ) / n
DELTA(v) = ( v2 - v1 ) / m,
where n, u1, u2, m, v1, and v2 are the arguments to the most recent glMapGrid2 command. Then, if mode is GL_FILL, the glEvalMesh2 command
is equivalent to:
for ( j = j1; j < j2; j += 1 ) {
glBegin( GL_QUAD_STRIP );
for ( i = i1; i <= i2; i += 1 ) {
glEvalCoord2( i dot DELTA(u) + u1, j dot DELTA(v) + v1 );
glEvalCoord2( i dot DELTA(u) + u1, (j+1) dot DELTA(v) + v1 );
}
glEnd();
}
If mode is GL_LINE, then a call to glEvalMesh2 is equivalent to:
for ( j = j1; j <= j2; j += 1 ) {
glBegin( GL_LINE_STRIP );
for ( i = i1; i <= i2; i += 1 )
glEvalCoord2( i dot DELTA(u) + u1, j dot DELTA(v) + v1 );
glEnd();
}
for ( i = i1; i <= i2; i += 1 ) {
glBegin( GL_LINE_STRIP );
for ( j = j1; j <= j1; j += 1 )
glEvalCoord2( i dot DELTA(u) + u1, j dot v + v1 );
glEnd();
}
And finally, if mode is GL_POINT, then a call to glEvalMesh2 is equivalent to:
glBegin( GL_POINTS );
for ( j = j1; j <= j2; j += 1 )
for ( i = i1; i <= i2; i += 1 )
glEvalCoord2( i dot u + u1, j dot DELTA(v) + v1 );
glEnd();
In all three cases, the only absolute numeric requirements are that if i = n, then the value computed from i dot DELTA(u) + u1 is exactly
u2, and if j = m, then the value computed from j dot DELTA(v) + v1 is exactly v2.
ERRORS
GL_INVALID_ENUM is generated if mode is not an accepted value.
GL_INVALID_OPERATION is generated if glEvalMesh is executed between the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GL_MAP1_GRID_DOMAIN
glGet with argument GL_MAP2_GRID_DOMAIN
glGet with argument GL_MAP1_GRID_SEGMENTS
glGet with argument GL_MAP2_GRID_SEGMENTS
SEE ALSO
glBegin, glEvalCoord, glEvalPoint, glMap1, glMap2, glMapGrid
GLEVALMESH(3G)