Now I want to grep 20131002 and if it finds pattern "20131002" it should scan lines below "20131002" and if it finds the word "Voice" that comes after grepping "20131002, than script print out all such occurrences in the file. Script Output would look like below.
If the very first line of the file has 20131002, and the very last line of the file has Voice, with no other hits inbetween -- is that a valid match? If not, why not?
No first line is not "20131002" and last line is not "Voice", script first grep 20131002 and than scan lines below as soon as it come across first "Voice" it prints and search for other such patterns by grepping "20131002" and than lines below it, to search "Voice". And than prints all such patterns found.
Yes, sorry for the confusion, let me put it in more simple way.
Example:
So my script first grep pattern "20130210" once found, it should scan line below and scan for Apple, if Apple is found it should print. Output would look like below
"20130210154634 Apple"
"20130210171829 Apple"
Apple is printed to its corresponding "20130210" only, which is unique.
But if grep pattern "20130210" once found and it scans lines below and finds "Banana" or "Mango" it should exit and search for other grep pattern "20130210" and scan lines below it, as soon as it finds the first "Apple" it should exit and find other such patterns.
I have a file with a list of references towards the end and want to apply a grep for some string.
text ....
@unnumbered References
@sp 1
@paragraphindent 0
2017. @strong{Chalenski, D.A.}; Wang, K.; Tatanova, Maria; Lopez,
Jorge L.; Hatchell, P.; Dutta, P.; @strong{Small airgun... (1 Reply)
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)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
$ cat file.log
Message Number = : Sending message 10:50:16^|^reqhdr.dummyid^=^02^|^reqhdr.timezone^=^GMT+05:30^|^DUMMYREQUEST^=^BH||||||||||||||||||$BD|OL|C|V||DummyAcctNo|02||24/12/2011|ST_DDM|DDM||||||||reqUUID110612105016$BT||||||||||||||||||$] Length
I have the above line in the... (4 Replies)
Hi,
I have got the below requirement. please suggest.
I have a file like,
Processing Item is:
/data/ing/cfg2/abc.txt
/data/ing/cfg3/bgc.txt
Processing Item is:
/data/cmd/for2/ght.txt
/data/kernal/config.klgt.txt
I want to process the above file to get the output file like,
... (5 Replies)
I have a txt file with more than 10000 lines. There is a unique pattern which is scattered into the file. it starts with @9 and it has 15 characters. i need to grep them and display along with line numbers.
Eg: File - Test1
test message....
....
..
..
@9qwerty89
...test message... (8 Replies)
Hi I have the following Input
--
-- TABLE: BUSINESS_UNIT
--
ALTER TABLE RATINGS.BUSINESS_UNIT ADD CONSTRAINT FK1_BUSINESS_UNIT
FOREIGN KEY (PEOPLESOFT_CHART_FIELD_VALUE_ID)
REFERENCES RATINGS.PEOPLESOFT_CHART_FIELD_VALUE(PEOPLESOFT_CHART_FIELD_VALUE_ID)
;
ALTER TABLE... (1 Reply)
Hello everyone,
I have been trying to get a list of all files containing a line of this type:
};#followed by anything
with any spaces (0 or more or 0 or more tabs) before the } and between each of the characters.
I have been trying this :
grep '*}*;*#*' *.c
but I have not been fully... (1 Reply)
Hi how do i grep only a part of the line from a file from all the lines.
file:
asdfgh 543212376 nag
lkjh abhilash 543757858
How do i grep and print only 543212376 and 543757858
Can i grep something like 543* and print only that. (3 Replies)