10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am trying to parse a file searching for specific set of string and then within those set of strings finding a keyword. The script works the way that I intended it to be but I thought it could be a lot simpler may be.
Any advice will be much appreciated.
The script at the moment is as... (1 Reply)
Discussion started by: newbie_01
1 Replies
2. Shell Programming and Scripting
Hi !
I want to search a string in all lines with sed. If that string is there, i want to look for an other string in the next line.If that string is there i want to put an other line under it.
eg:
aaa
bbb
ccc
ddd
cat bla.txt | sed -e '/aaa/a\' -e ' \!!!'
in the upper case, i would... (6 Replies)
Discussion started by: fugitivus
6 Replies
3. Shell Programming and Scripting
Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed
Bold letters are the stations . The whole file has multiple stations .
Below example i wanted to search... (4 Replies)
Discussion started by: ajayram_arya
4 Replies
4. Shell Programming and Scripting
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies
5. Shell Programming and Scripting
Hi
I have below script which is used to grep specific errors and if error string matches send an email alert.
Script is working fine , however , i wish to print next 10 lines of the string match to get the details of error in the email alert
Current code:-
#!/bin/bash
tail -Fn0 --retry... (2 Replies)
Discussion started by: neha0785
2 Replies
6. Shell Programming and Scripting
I need to search this "<CardinalMPI>" string and replace the same string above two lines of the string.
Nov 16, 2012 12:58:34 PM
INFO: Centinel LookUp ResponseXML : <CardinalMPI>
<ReasonCode></ReasonCode>
<ErrorDesc></ErrorDesc>
<MerchantReferenceNumber></MerchantReferenceNumber>... (4 Replies)
Discussion started by: laknar
4 Replies
7. Shell Programming and Scripting
What's the easiest way to search a file for a specific string and then look for other instances after that? I want to search for all Virtual Hosts and print out the Server Name and Document Root (if it has that info), while discarding the rest of the info.
Basically my file looks like this:
...... (6 Replies)
Discussion started by: Mbohmer
6 Replies
8. Shell Programming and Scripting
Hi Guys,
I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same.
can anyone of you please let me know how to go about it ? (8 Replies)
Discussion started by: sukrish
8 Replies
9. Shell Programming and Scripting
I have a command which prints #lines after and before the search string in the huge file
nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print;c=a}b{r=$0}' b=0 a=10 s="STRING1" FILE
The file is 5 gig big.
It works great and prints 10 lines after the lines which contains search string in... (8 Replies)
Discussion started by: prash184u
8 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have a file with the following contents:
COMPANY ABCD
TRUCKER JOE SMITH
TRUCK 456
PLATE A12345678
TRUCKER BILL JONES
TRUCK 789
PLATE B7894561
I need to create a script or search command that will search for this string '789' in the file. This string is unique and only... (7 Replies)
Discussion started by: doza22
7 Replies