Sponsored Content
Top Forums Shell Programming and Scripting How to remove lines before and after with awk / sed ? Post 302440907 by nareshprasannar on Thursday 29th of July 2010 01:09:04 AM
Old 07-29-2010
How to remove lines before and after with aw / sed ?

Could you please be more descriptive on the pattern of your input file and what exactly your requirement is??
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sed or Awk to remove specific lines

I have searched the forum for this - forgive me if I missed a previous post. I have the following file: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah alter table "informix".esc_acct add constraint (foreign key (fi_id) references "informix".fi ... (5 Replies)
Discussion started by: Shoeless_Mike
5 Replies

2. Shell Programming and Scripting

using sed to remove lines

Can somebody explain why my sed command is not working. I do the folloinwg: Generates a binary file to /tmp/x1.out /usr/lib/sa/sa2 -s 4:00 -e 8:00 -i 3600 -A -o /tmp/x1.out decodes the file (no problem so far) sar -f /tmp/x1.out When I do this it does not appear to delete the... (4 Replies)
Discussion started by: BeefStu
4 Replies

3. Shell Programming and Scripting

Command to remove duplicate lines with perl,sed,awk

Input: hello hello hello hello monkey donkey hello hello drink dance drink Output should be: hello hello monkey donkey drink dance (9 Replies)
Discussion started by: cola
9 Replies

4. Shell Programming and Scripting

SED to remove a line above and lines below.

:confused:Hi All, I need help on removing lines in a text file. Sample file : When there is a match ip for IPAddress in my `cat ip.out`, proceed delete line above until string "Comp" is found. Thank you very much. ---------- Post updated at 12:56 AM ---------- Previous update was... (4 Replies)
Discussion started by: chiewming
4 Replies

5. Shell Programming and Scripting

Locate and remove lines with sed

Gents, I would like to remove some lines from a big file ( file2). The objetive is to remove all the lines in file2 containing a certain string which are in file data2delete.. file data2delete contens: 2573.0 7260.01 2893.0 7255.01 2903.0 7245.01 2897.0 7255.01 2561.0 7255.01... (6 Replies)
Discussion started by: jiam912
6 Replies

6. Shell Programming and Scripting

Using sed, awk or perl to remove substring of all lines except the first

Greetings All, I would like to find all occurences of a pattern and delete a substring from the all matching lines EXCEPT the first. For example: 1234::group:user1,user2,user3,blah1,blah2,blah3 2222::othergroup:user9,user8 4444::othergroup2:user3,blah,blah,user1 1234::group3:user5,user1 ... (11 Replies)
Discussion started by: jacksolm
11 Replies

7. UNIX for Dummies Questions & Answers

How to remove certain lines using sed?

Hi I have the following kind of line sin my file . print ' this is first'. print ' this is firs and next ' ' line continuous '. -- this is entire print line. print ' this is first and next ' ' line continuous and' 'still there now over'. -- this 3lines together a single print line. ... (5 Replies)
Discussion started by: Sivajee
5 Replies

8. Shell Programming and Scripting

How to remove certain lines using sed?

Hi, I am new to unix and i started some scripting recently. Please go through the following script i wrote. #!/bin/sh file='path../tfile' file1='path../tfile1' rmfile='path../test2' C1=1 C2=1 exec 3< $file1 while read LINE1; do read LINE2 <&3 a=$LINE1 b=`expr $LINE2 - 1` ... (1 Reply)
Discussion started by: Subbu123
1 Replies

9. Shell Programming and Scripting

awk to remove lines that do not start with digit and combine line or lines

I have been searching and trying to come up with an awk that will perform the following on a converted text file (original is a pdf). 1. Since the first two lines are (begin with) text they are removed 2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies

10. UNIX for Beginners Questions & Answers

awk with sed to combine lines and remove specific odd # pattern from line

In the awk piped to sed below I am trying to format file by removing the odd xxxx_digits and whitespace after, then move the even xxxx_digit to the line above it and add a space between them. There may be multiple lines in file but they are in the same format. The Filename_ID line is the last line... (4 Replies)
Discussion started by: cmccabe
4 Replies
PTHREAD_GETNAME_NP(3)					   BSD Library Functions Manual 				     PTHREAD_GETNAME_NP(3)

NAME
pthread_getname_np -- get and set descriptive name of a thread LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread.h> int pthread_getname_np(pthread_t thread, char *name, size_t len); int pthread_setname_np(pthread_t thread, const char *name, void *arg); DESCRIPTION
The pthread_getname_np() function obtains the descriptive name of a thread. It takes the following arguments: thread The thread whose descriptive name will be obtained. name The buffer to be filled with the descriptive name of the thread. len The size of the buffer name in bytes. The pthread_setname_np() function sets the descriptive name of a thread. It takes the following arguments: thread The thread whose descriptive name will be set. name The printf(3) format string to be used to construct the descriptive name of the thread. The resulted descriptive name should be shorter than PTHREAD_MAX_NAMELEN_NP. arg The printf(3) argument used with name. RETURN VALUES
Both functions return 0 on success. Otherwise, an error number is returned to indicate the error. COMPATIBILITY
Both functions are non-standard extensions. ERRORS
Both functions may fail if: [EINVAL] Invalid parameter. [ESRCH] Non-existent thread. The pthread_setname_np() function may also fail if: [ENOMEM] There was insufficient memory for the operation. SEE ALSO
pthread_attr_get_np(3), pthread_attr_getname_np(3) BSD
July 9, 2010 BSD
All times are GMT -4. The time now is 01:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy