Sponsored Content
Top Forums Shell Programming and Scripting How to grep a portion of line Post 302597021 by proactiveaditya on Thursday 9th of February 2012 02:52:53 AM
Old 02-09-2012
Quote:
Originally Posted by balajesuri
1. Your requirements keep changing over the posts.
2. One way to achieve requirement mentioned in post #5 is to write a script that will keep scanning the file until a certain condition is met.
1) Extremely sorry for that.
2) How? Can you help with the basic logic.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

erasing portion of line with sed

hi, I'm trying to use sed to erase everything, and including the ending parenthesis. For example: input: blah blah blah (12355)this is what i want. output: this is what i want. how would i do this? i found an example online that does the opposite: sed \"s|test.*||g\" file1 > file2"; ... (5 Replies)
Discussion started by: gammaman
5 Replies

2. UNIX for Dummies Questions & Answers

erasing portion of line with sed (only once)

hi, I'm trying to use sed to erase everything, up to the first parenthesis. for example: input: blah blah blah (aldj) test (dafs) test test. output: (aldj) test (dafs) test test. how would i do this? I was fooling around with the parenthesis, and i only got it to apply on all parenthesis.... (1 Reply)
Discussion started by: gammaman
1 Replies

3. Shell Programming and Scripting

Delete a portion of a line using shell scripting

Hi all, I am new to awk programs.I have a file like this 1234567@2345||adcbdefhij: asgdfdasdfhhfd-asdfasd-dsfasdf |0.678|0.0|0.213 1234567@2345||adcbdefhij: ashhfd-asdfasd-dsfasdf |0.129|0.0|0.411 1234567@2345||adcbdefhij: asd-aasd-dasdf |0.223|0.0|0.276 I want to delete the text which... (3 Replies)
Discussion started by: Loy81
3 Replies

4. Shell Programming and Scripting

Print a portion of a line

Hi, I am facing a little problem... I have a line like this : asdcvashfasashXXXXxxxzxcadd:sdcashjqdasdsmgdkdaxdsnd; I want to print just a portion of line i.e starting from left 5 characters from ":" and upto ";" i.e. in this case it would be "xcadd:sdcashjqdasdsmgdkdaxdsnd;" The length of... (2 Replies)
Discussion started by: vanand420
2 Replies

5. Shell Programming and Scripting

Grep certain portion from the file

Dear Friends, Here I am with another difficulty. I have a flat file from which I wanna grep following pattern. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Statement Date : Blah blah Blah blah Blah blah Blah blah... (1 Reply)
Discussion started by: anushree.a
1 Replies

6. UNIX for Advanced & Expert Users

Grep a portion of the log file

I want to grep a portion of the log file. grepping a particular pattern and including 10 lines before that and after that occurence. grep -n "SomeString Pattern" filename 10 lines before this occurence and 10 lines after that. Please help. Need the simple script not in awk or sed. (9 Replies)
Discussion started by: sainipardeep
9 Replies

7. Shell Programming and Scripting

Print portion line in SED

Hi, This is more a theoretical question, because I usually solved that with perl or even java, but I would like to know if it exists an easy way to do it with SED. Using regular expresions it's very easy to select an portion line. Does it exist an easy way for printing those portions in SED?... (1 Reply)
Discussion started by: islegmar
1 Replies

8. UNIX for Dummies Questions & Answers

Grab Portion of Output Text (sed, grep, awk?)

Alright, here's the deal. I'm running the following ruby script (output follows): >> /Users/name/bin/acweather.rb -z 54321 -o /Users/name/bin -c Clouds AND Sun 57/33 - Mostly sunny and cool I want to just grab the "57/33" portion, but that's it. I don't want any other portion of the line. I... (5 Replies)
Discussion started by: compulsiveguile
5 Replies

9. Shell Programming and Scripting

Shell to display portion of a line

Thanks a lot for the code and the explanation. Now my final requirement. I have uploaded 3 files as attachment. Please open the files in Editplus or any other text editor which keeps the formatting. GMDCOM.27936.log.txt------I want to pick only Process request from this file.(Please check... (9 Replies)
Discussion started by: ghosh_tanmoy
9 Replies

10. UNIX for Beginners Questions & Answers

How do I separate a portion of a file name to use grep on?

I'm trying to write a script that takes a file name in the form of Name_Num1_Num2.Extension and I want to separate the name portion and then use grep to see if that name part has any illegal characters in it. I already have my grep command written and it works, I'm not sure how to separate the... (5 Replies)
Discussion started by: steezuschrist96
5 Replies
AuScanEvents(3) 					     Library Functions Manual						   AuScanEvents(3)

Name
       AuScanEvents - return the first event that satisfies the predicate

Synopsis
       #include <audio/audiolib.h>

       AuBool AuScanEvents(server, mode, dequeue, predicate, arg, event)
	   AuServer *server;
	   int mode;
	   AuBool dequeue;
	   AuBool (*predicate)(AuServer *,AuEvent *, AuPointer);
	   AuPointer arg;
	   AuEvent *event; /* RETURN */

Arguments
       server	 Specifies the connection to the audio server.

       mode	 Specifies how far to look for a match.  This should be one of these constants: AuEventsQueuedAlready, AuEventsQueuedAfterReading,
		 or AuEventsQueuedAfterFlush.

       dequeue	 Specifies if a matching event is found, should it be removed from the queue.

       predicate Specifies the procedure that is called to determine if an event matches the criteria.

       arg	 Specifies any additional arguments to be passed to the predicate procedure.

       event	 Returns the matching event if found.

Description
       AuScanEvents scans the event queue looking for the first event that satisfies the caller-supplied predicate.  If mode is  AuEventsQueuedAl-
       ready,  AuScanEvents  only checks for events already in the queue.  If mode is AuEventsQueuedAfterReading, and a matching event isn't found
       already in the queue, AuScanEvents attempts to read more events out of the application's connection.  If mode  is  AuEventsQueuedAfterFlush
       and  a  matching  event	isn't already in the queue or isn't waiting to be read, AuScanEvents flushes the output queue and attempts to read
       more events out of the application's connection.  If dequeue is AuTrue, and a matching event is found, it is removed from the  queue.   The
       predicate procedure is called with the arguments server, event, and arg and should return AuTrue to indicate a match.

See Also
       AuEventsQueued, AuScanForTypedEvent, AuNextEvent.

       audiolib - Network Audio System C Language Interface

audiolib - event handling					       1.9.3							   AuScanEvents(3)
All times are GMT -4. The time now is 06:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy