Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Replace first occurrence after match Post 302884047 by arup1980 on Friday 17th of January 2014 08:17:31 AM
Old 01-17-2014
Hi ,
Thanks all for your reply ..

I have the similar query but for my case I want add another line before that matched line (ie, Realized what you gotta do).

thanks in advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print last occurrence if first field match

Hi All, I have an input below. If the term in the 1st column is equal, print the last row which 1st column is equal.In the below example, it's " 0001 k= 27 " and " 0004 k= 6 " (depicted in bold). Those terms in 1st column which are not repetitive are to be printed as well. Can any body help me... (9 Replies)
Discussion started by: Raynon
9 Replies

2. Shell Programming and Scripting

last occurrence of a match through multiple files

Hi all, I have a lot of files with extension ".o" and I would like to extract the 10th line after (last) occurrence of a given string in each of the files. I tried: $ grep "string_to_look_for" *.o -A 10 | tail -1 but it gives the occurrence in the last file with extension .o ... (1 Reply)
Discussion started by: f_o_555
1 Replies

3. Shell Programming and Scripting

SED to replace exact match, not first occurrence.

Lets say I have file.txt: (Product:Price:QuantityAvailable) (: as delimiter) Chocolate:5:5 Banana:33:3 I am doing a edit/update function. I want to change the Quantity Available, so I tried using the SED command to replace 5, but my Price which is also 5 is changed instead. (for the Banana... (13 Replies)
Discussion started by: andylbh
13 Replies

4. Shell Programming and Scripting

[Solved] Sed/awk print between patterns the first occurrence

Guys, I am trying the following: i have a log file of a webbap which logs in the following pattern: 2011-08-14 21:10:04,535 blablabla ERROR blablabla bla bla bla bla 2011-08-14 21:10:04,535 blablabla ERROR blablabla bla bla bla ... (6 Replies)
Discussion started by: ppolianidis
6 Replies

5. Shell Programming and Scripting

sed print from last occurrence match until the end of file

Hi, i have file f1.txt with data like: CHECK a b CHECK c d CHECK e f JOB_START .... I want to match the last occurrence of 'CHECK' until the end of the file. I can use awk: awk '/^CHECK/ { buf = "" } { buf = buf "\n" $0 } END { print buf }' f1.txt | tail +2Is there a cleaner way of... (2 Replies)
Discussion started by: ysrini
2 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Awk: count occurrence of each character for every field

Hi, let's say an input looks like: A|C|C|D A|C|I|E A|B|I|C A|T|I|B as the title of the thread explains, I am trying to get something like: 1|A=4 2|C=2|B=1|T=1 3|I=3|C=1 4|D=1|E=1|C=1|B=1 i.e. a count of every character in each field (first column of output) independently, sorted... (4 Replies)
Discussion started by: beca123456
4 Replies

7. Shell Programming and Scripting

[Solved] Last occurrence of a string

I apologize if it was asked before but I couldn't find something related. I want to replace 2 strings in a file e.g pwddb=Lar1wod (need to replace string after =) pwdapp=Wde2xe (need to replace string after =) AND in same file want to find last occurrence of a string (SR2-134561),... (2 Replies)
Discussion started by: J_ang
2 Replies

8. Shell Programming and Scripting

Egrep - Only Match First Occurrence

echo 'String#1 and String#2' | egrep -o -m 1 'String#.{1}' String#1 String#2 I'm trying to just match the first occurrence of 'String#' + 1 character. I thought the "-m 1" switch would do that for me. Instead I get both occurrences. Can somebody provide some insight? Thanks! (5 Replies)
Discussion started by: sudo
5 Replies

9. UNIX for Dummies Questions & Answers

Code for exact match to count occurrence

Hi all, I have an input file as below. I would like to count the occurrence of pattern matching 8th field for each line. Input: field_01 field_02 field_03 field_04 field_05 field_06 field_07 field_08 TA T TA T TA TA TA... (3 Replies)
Discussion started by: huiyee1
3 Replies

10. Shell Programming and Scripting

sed print from last occurrence match until the end of last occurrence match

Hi, i have file file.txt with data like: START 03:11:30 a 03:11:40 b END START 03:13:30 eee 03:13:35 fff END jjjjjjjjjjjjjjjjjjjjj START 03:14:30 eee 03:15:30 fff END ggggggggggg iiiiiiiiiiiiiiiiiiiiiiiii I want the below output START (13 Replies)
Discussion started by: Jyotshna
13 Replies
xcb_glx_get_mapfv(3)						   XCB Requests 					      xcb_glx_get_mapfv(3)

NAME
xcb_glx_get_mapfv - SYNOPSIS
#include <xcb/glx.h> Request function xcb_glx_get_mapfv_cookie_t xcb_glx_get_mapfv(xcb_connection_t *conn, xcb_glx_context_tag_t context_tag, uint32_t target, uint32_t query); Reply datastructure typedef struct xcb_glx_get_mapfv_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint8_t pad1[4]; uint32_t n; xcb_glx_float32_t datum; uint8_t pad2[12]; } xcb_glx_get_mapfv_reply_t; Reply function xcb_glx_get_mapfv_reply_t *xcb_glx_get_mapfv_reply(xcb_connection_t *conn, xcb_glx_get_mapfv_cookie_t cookie, xcb_generic_error_t **e); Reply accessors xcb_glx_float32_t *xcb_glx_get_mapfv_data(const xcb_glx_get_mapfv_request_t *reply); int xcb_glx_get_mapfv_data_length(const xcb_glx_get_mapfv_reply_t *reply); xcb_generic_iterator_t xcb_glx_get_mapfv_data_end(const xcb_glx_get_mapfv_reply_t *reply); REQUEST ARGUMENTS
conn The XCB connection to X11. context_tag TODO: NOT YET DOCUMENTED. target TODO: NOT YET DOCUMENTED. query TODO: NOT YET DOCUMENTED. REPLY FIELDS
response_type The type of this reply, in this case XCB_GLX_GET_MAPFV. This field is also present in the xcb_generic_reply_t and can be used to tell replies apart from each other. sequence The sequence number of the last request processed by the X11 server. length The length of the reply, in words (a word is 4 bytes). n TODO: NOT YET DOCUMENTED. datum TODO: NOT YET DOCUMENTED. DESCRIPTION
RETURN VALUE
Returns an xcb_glx_get_mapfv_cookie_t. Errors have to be handled when calling the reply function xcb_glx_get_mapfv_reply. If you want to handle errors in the event loop instead, use xcb_glx_get_mapfv_unchecked. See xcb-requests(3) for details. ERRORS
This request does never generate any errors. SEE ALSO
AUTHOR
Generated from glx.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. XCB
2014-06-10 xcb_glx_get_mapfv(3)
All times are GMT -4. The time now is 09:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy