Sponsored Content
Full Discussion: Advanced grep and sed
Top Forums Shell Programming and Scripting Advanced grep and sed Post 302303456 by phudgens on Thursday 2nd of April 2009 04:36:58 PM
Old 04-02-2009
Advanced grep and sed

I am wondering if there is a way via grep and sed to extract a string that is on the 2nd line below a known marker as in this example:

TextRel 203 0 0 "WELL:"
SetPosAbs 1287 -6676
TextRel 210 0 0 "AEP #2"

The marker is WELL:, but the string I need is "AEP #2". Can grep/sed handle this or is some sort of read command required?

Thanks,

Paul H.
Denver
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep/Sed help?

I'm a UNIX novice and am currently using a grep stmt to search for a pattern and send the matching lines to a new file. But what I really want to do is to append the line after the matching line to the matching line in the new file. Any ideas? 3/17/04 I am using the Bourne shell. And... (3 Replies)
Discussion started by: CKS
3 Replies

2. Shell Programming and Scripting

using sed to grep

I have a file that contains many instances of double dollar signs. I want to use sed to get the first occurrence. for example, given the following data. #Beginning of file AB 34 $$ AB $$ AB 98 $$ I only want to pull out: AB 34 $$ (1 Reply)
Discussion started by: wxornot
1 Replies

3. UNIX for Dummies Questions & Answers

sed or grep?

hello everybody! I have a html file which is not properly formatted meaning that the whole content is in one line. I want to to cut out certain parts of that file. Those parts are between ' #" ' and ' " ' and always start with ' sec_ ' and after the ' sec_ ' any number of characters and ' _... (2 Replies)
Discussion started by: MastaFue
2 Replies

4. UNIX for Dummies Questions & Answers

| help | unix | grep (GNU grep) 2.5.1 | advanced regex syntax

Hello, I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax a guide. ls -aLl /bin | grep "\(x\)" Which works, just highlights 'x' where ever, when ever. I'm trying to to get (?:) to work but... (4 Replies)
Discussion started by: MykC
4 Replies

5. UNIX for Dummies Questions & Answers

Advanced grep'in... grep for data next to static element.

I have a directory I need to grep which consists of numbered sub directories. The sub directory names change daily. A file resides in this main directory that shows which sub directories are FULL backups or INCREMENTAL backups. My goal is to grep the directory for the word "full" and then... (2 Replies)
Discussion started by: SysAdm2
2 Replies

6. Shell Programming and Scripting

Advanced sed/awk help

I have thousands of files in HTML that looks like this: .... .... .... <!-- table horaire --> <!-- table horaire --> <table border="0" cellspacing="0" cellpadding="0" class="tblHoraires" summary="Table des horaires de la ligne 12"> <tr> <th scope="row"... (13 Replies)
Discussion started by: charafantah
13 Replies

7. Linux

sed and grep

I am stranded with a problem. Please solve. How will you remove blank lines from a file using sed and grep? ( blank line contains nothing or only white spaces). I run the below commands of sed and grep but grep isn't giving output as desired. Why? sed '/^*$/d' blank grep -v "^*$" blank... (3 Replies)
Discussion started by: ravisingh
3 Replies

8. Shell Programming and Scripting

Help with sed/grep

Hi, I have a file with reoccurring patterns and I want extract the 3rd line after the match, then delete another pattern from that third line. For example the file is in the following format: Hello Name: Abc Number: 123 Hello Name: FQE Number: 543 This occurs more than 100... (4 Replies)
Discussion started by: wsn
4 Replies

9. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies

10. Shell Programming and Scripting

Text manipulation with sed - Advanced technic

Hello everybody, I have the following input file: START ANALYSIS 1 DATA LINE DATA LINE DATA LINE DATA LINE Libray /home/me/myLibrary Source library_name_AAAAA DATA LINE DATA LINE DATA LINE BEGIN SOURCE ANALYSIS Function A Function B Function C Function D (4 Replies)
Discussion started by: namnetes
4 Replies
AECHO(1)							   Netatalk 2.2 							  AECHO(1)

NAME
aecho - send AppleTalk Echo Protocol packets to network hosts SYNOPSIS
aecho [ -c count ] ( address | nbpname ) DESCRIPTION
aecho repeatedly sends an Apple Echo Protocol (AEP) packet to the host specified by the given AppleTalk address or nbpname and reports whether a reply was received. Requests are sent at the rate of one per second. address is parsed by atalk_aton(3). nbpname is parsed by nbp_name(3). The nbp type defaults to `Workstation'. When aecho is terminated, it reports the number of packets sent, the number of responses received, and the percentage of packets lost. If any responses were received, the minimum, average, and maximum round trip times are reported. EXAMPLE
Check to see if a particular host is up and responding to AEP packets: example% aecho bloodsport 11 bytes from 8195.13: aep_seq=0. time=10. ms 11 bytes from 8195.13: aep_seq=1. time=10. ms 11 bytes from 8195.13: aep_seq=2. time=10. ms 11 bytes from 8195.13: aep_seq=3. time=10. ms 11 bytes from 8195.13: aep_seq=4. time=10. ms 11 bytes from 8195.13: aep_seq=5. time=9. ms ^C ----8195.13 AEP Statistics---- 6 packets sent, 6 packets received, 0% packet loss round-trip (ms) min/avg/max = 9/9/10 OPTIONS
-c count Stop after count packets. SEE ALSO
ping(1), atalk_aton(3), nbp_name(3), aep(4), atalkd(8). Netatalk 2.2 17 Dec 1991 AECHO(1)
All times are GMT -4. The time now is 09:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy