-- 




 
Hi,


The content of file hello.c is as given below.
I want to count how many + and - are there in this file.
I had equivalent shel command to count no. of + and -, 

grep -e "^+[^+]" diffs.txt | wc -l
grep -e "^-[^-]" diffs.txt | wc -l

Can anyone help me how to write perl script using regular expression
which should count no. of + and -.

+++ hello.c     8 Mar 2006 13:55:13 -0000       1.9
@@ -1,16 +1,19 @@
+func()
+{
+       print("eep Si\n";
+printf("This line has been added after first commit by sandeep");
+printf("Hi iam last time committing");
+printf("Hi iam inserting some change in the code.");
+}

-Hi ther i have been here
-
-hi ther good one
-
-Hi iam last time committing
-
-jkdklsf asdf



 
Thank you

Regards
Sandeep

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to