Sponsored Content
Top Forums UNIX for Beginners Questions & Answers awk or sed to print the character from the previous line after the regexp match Post 303042112 by kshitij on Sunday 15th of December 2019 09:16:24 AM
Old 12-15-2019
TCL script to match and extract the substring carrying the regex

Thanks but I am not able to put the same content in the text format since the lines are not getting aligned.
Thats why I have attached the attachments

--- Post updated at 08:46 PM ---

Input file

Code:
                                       p p p p p
Pin Numbers                             3 2 1 8 9
                                        1 2 3 4 5

pattern     offset                        
scan1        2965                       H L H L H
                                            ^
scan2        2200                       L H H L H 
                                          ^
scan3        1100                       H L L L L 
                                          ^
scan4        1500                       L L H H H 
                                            ^
scan5        2800                       H H L H H
                                          ^     ^

Please have a look at the attachment
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

print the line immediately after a regexp; but regexp is a sentence

Good Day, Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp. sed -n '/regexp/{n;p;}' filename What if my regexp is 3 word or a sentence. Im... (3 Replies)
Discussion started by: ownins
3 Replies

2. Shell Programming and Scripting

Print previous, current and next line using sed

Hi, how can i print the previous, current and next line using sed? current line is the matching line. The following prints all lines containing 'Failure' and also the immediate next line cat $file | sed -n -e '/Failure/{N;p;}' Now, i also want to print the previous line too. Thanks,... (8 Replies)
Discussion started by: ysrinu
8 Replies

3. Shell Programming and Scripting

awk;sed appending line to previous line....

I know this has been asked before but I just can't parse the syntax as explained. I have a set of files that has user information spread out over two lines that I wish to merge into one: User1NameLast User1NameFirst User1Address E-Mail:User1email User2NameLast User2NameFirst User2Address... (11 Replies)
Discussion started by: walkerwheeler
11 Replies

4. Shell Programming and Scripting

How to use sed to search for string and Print previous two lines and current line

Hello, Can anybody help me to correct my sed syntax to find the string and print previous two lines and current line and next one line. i am using string as "testing" netstat -v | sed -n -e '/test/{x;2!p;g;$!N;p;D;}' -e h i am able to get the previous line current line next line but... (1 Reply)
Discussion started by: nmadhuhb
1 Replies

5. UNIX for Dummies Questions & Answers

Awk to print data from current and previous line

Hi guys, I have found your forum super useful. However, right now I am stuck on a seemingly "simple" thing in AWK. I have two columns of data, the first column in Age (in million years) and the second column is Convergence Rate (in mm/yr). I am trying to process my data so I can use it to... (2 Replies)
Discussion started by: awk_noob_456
2 Replies

6. Shell Programming and Scripting

awk, sed or perl regexp to print values from file

Hello all According to the following file (orignal one contains 200x times the same structure...) I was wondering if someone could help me to print <byte>??</byte> values example, running this script/command like ./script.sh xxapp I would expect as output: 102 116 112 ./script.sh xxapp2... (2 Replies)
Discussion started by: cabrao
2 Replies

7. Shell Programming and Scripting

Remove previous line if next & previous lines have same 4th character.

I want to remove commands having no output. In below text file. bash-3.2$ cat abc_do_it.txt grpg10so>show trunk group all status grpg11so>show trunk group all status grpg12so>show trunk group all status GCPKNYAIGT73IMO 1440 1345 0 0 94 0 0 INSERVICE 93% 0%... (4 Replies)
Discussion started by: Raza Ali
4 Replies

8. Shell Programming and Scripting

sed print first line before regexp and all lines after

Hi All I'm trying to extract the line just above a regexp and all lines after this. I'm currently doing this in two steps sed -n -e "/^+---/{g;p;}" -e h oldfile.txt > modified.txt sed -e "1,/^+---/d" -e "/^$/d" oldfile.txt >>modified.txt Sample sometext will be here sometext will be... (3 Replies)
Discussion started by: Celvin VK
3 Replies

9. Shell Programming and Scripting

awk script -print line when $2 > $2 of previous line

Hi all, From a while loop I am reading a sorted file where I want to print only the lines that have $1 match and $2 only when the difference from $2 from the previous line is > 30. Input would be like ... AN237 010 193019 0502 1 CSU Amoxycillin AN237 080 ... (2 Replies)
Discussion started by: gafoleyo73
2 Replies

10. AIX

Print nth previous line after match

Please help me print nth line after match awk or sed one line command. (3 Replies)
Discussion started by: sushma123
3 Replies
GLINVALIDATEFRAMEBUF(3G)					   OpenGL Manual					  GLINVALIDATEFRAMEBUF(3G)

NAME
glInvalidateFramebuffer - invalidate the content some or all of a framebuffer object's attachments C SPECIFICATION
void glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments); PARAMETERS
target The target to which the framebuffer is attached. target must be GL_FRAMEBUFFER, GL_DRAW_FRAMEBUFFER, or GL_READ_FRAMEBUFFER. numAttachments The number of entries in the attachments array. attachments The address of an array identifying the attachments to be invalidated. DESCRIPTION
glInvalidateFramebuffer invalidates the content of a specified set of attachments of a framebuffer. The framebuffer whose content to invalidate is indicated by setting target to the target to which it is bound. target may be GL_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_DRAW_FRAMEBUFFER. GL_FRAMEBUFFER is treated as if it were GL_DRAW_FRAMEBUFFER. The set of attachments whose content to invalidate are specified in an array whose address is given by attachments and which contains numAttachments elements. The elements of attachments must be GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENTGL_DEPTH_STENCIL_ATTACHMENT, or GL_COLOR_ATTACHMENTi, where i is between zero and the value of GL_MAX_FRAMEBUFFER_ATTACHMENTS minus one. Furthermore, if the default framebuffer is bound to target, then attachments may contain GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT, GL_AUXi, GL_ACCUM, GL_COLOR, GL_DEPTH, or GL_STENCIL, identifying that specific buffer. GL_COLOR, is treated as GL_BACK_LEFT for a double-buffered context and GL_FRONT_LEFT for a single-buffered context. After glInvalidateFramebuffer is executed, the contents of the specified attachments become undefined. ERRORS
GL_INVALID_ENUM is generated if target is not one of the accepted framebuffer target tokens. GL_INVALID_ENUM is generated if any element of attachments is not one of the accepted framebuffer attachment tokens. GL_INVALID_OPERATION is generated if element of attachments is GL_COLOR_ATTACHMENTi where i is greater than or equal to the value of GL_MAX_COLOR_ATTACHMENTS. ASSOCIATED GETS
glGet() with argument GL_MAX_COLOR_ATTACHMENTS SEE ALSO
glInvalidateTexSubImage(), glInvalidateTexImage(), glInvalidateBufferSubData(), glInvalidateBufferData(), glInvalidateSubFramebuffer(). 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 GLINVALIDATEFRAMEBUF(3G)
All times are GMT -4. The time now is 05:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy