I want to use find to locate files with two different extensions, and run a grep on the results. The closest I have gotten is incredibly slow and ugly:
for i in `ls -laR|egrep -e '(.js|.css)'`; do find . -name $i -print|xargs grep -H searchBg; done;
This method makes my eyes bleed. Help! ;)
... (2 Replies)
can't figure out a way to delete multiple empty lines but keep single empty lines in a file, file is like this
#cat file
1
2
3
4
5
6
-
What I want is
1
2 (6 Replies)
Let's say I'm trying to match potentially multiple sets of parentheses. Is there a way in a regular expression to force a match of closing parentheses specifically in the number of the opening parentheses?
For example, if the string is "((foo bar))", I want to be able to say "match any number of... (7 Replies)
I've got a longish log file with content such as
Uplink traffic:
Downlink traffic:
I want to parse the log file and remove any line that contains the string "Uplink traffic:" at the beginning of the line, but only if the line following it beginnings with the string "Downlink traffic:" (in... (7 Replies)
Hi,
I've a logfile which i need to parse and get the logs depending upon the user input. here, i'm providing an option to enter the string which can be matched with the log entries.
e.g. one of the logfile entry reads like this -
$str = " mpgw(BLUESOAPFramework):... (6 Replies)
I have a large file of many pairs of sequences and their headers, which always begin with '>'
I'm looking for help on how to retain only sequences (and their headers) below a certain length. So if min length was 10, output would be
I can filter by length, but I'm not sure how to exclude... (3 Replies)
Dear Perl users,
Could somebody help me how to fix my code so I can get my desired output.
Here is the data:
Pattern Gabriel
halo1
halo2
end
Pattern Andreas
halo1
halo2
endI want to grep multiple lines between the pattern /Pattern Gabriel / and /end/.
Then I will store the output into... (6 Replies)
I am trying to match mulitple (3) variables. I found the sub given below on the web which works well when all vars are defined. But there are situations where one or two will not be defined (at least one will always be defined.)
Example of the variable content possibilities
The sub found... (4 Replies)
data.txt:
hellohellohello
mellomello1mello
tellotellotellotello
bellobellowbellow
vellow
My attempts:
egrep ".*mello1\n.*bellow" data.txt
awk '/.*mello1.*\nbellow/' data.txt
how can i search for patterns that are on different lines using simple egrep or awk?
i only want the... (7 Replies)