here is my whole script

###################################################################### +########### # this program will search the string in that +# # are present in the whole directory structure. + # # Pass command line arguments as follows---- + # # perl removestring.pl path Searchstring + # ###################################################################### +########### #!/usr/bin/perl use strict; use File::Find; use warnings; my $oldstring; my $newstring; my $path; my $i=0; sub checkArgs() { print $#ARGV+1; die "invalid no of arguments [path oldstring new string]!!" if $#ARGV ++1 !=2 ; for ( @ARGV ) { s/\\n/\n/g; } $oldstring="$ARGV[1]"; print "<<$oldstring>>\n"; $path=$ARGV[0]; print "path: $path ,string:$oldstring(y/n):"; my $ok=<STDIN>; chomp($ok); die "please run the program again with correct arguments:!!" if $ok n +e "y"; find(\&wanted,$path); print "\n\nString Found in $i Files"; } sub wanted { my $flag=0; $flag=1 if !-d && $File::Find::name =~ /.bteq$/; if($flag==1){ my $string=""; open FH1, "< $File::Find::name" or die "Couldn't open file: " +; while (<FH1>){ $string .= $_; } if($string=~ m/\Q$oldstring\E/){ print "\nstring found in ...\n$File::Find::name"; $i++; } } } checkArgs();

this is my file

SELECT JSON_col FROM stud_info_small ORDER BY JSON_col.stu_id; SELECT JSON_col FROM stud_info_small WHERE JSON_col.stu_id = "stu_10" ORDER BY JSON_col.stu_id; SELECT JSON_col FROM stud_info_small WHERE JSON_col.qualifications = "Associate Degree" ORDER BY JSON_col.stu_id; ORDER BY stud_doc.stud_id; ORDER BY stud_doc.stud_id;

arguments-- perl search.pl E:\foldername "stud_doc.su_id"


In reply to Re: need helpo regarding regular expression by praveenchappa
in thread need helpo regarding regular expression by praveenchappa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.