Hi:

How do I look for the string <filemap_generic> in the following file so that
i can insert something between the tags
<filemap_generic>
insert some bla text here
</filemap_generic>
in the following file?

------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

   <!DOCTYPE filemap>
     <filemap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:noNamespaceSchemaLocation="filemap.xsd">

<filemap_generic>

</filemap_generic>
</filemap>


On 7/12/06, Nishi Bhonsle <[EMAIL PROTECTED]> wrote:


Hi:
Sorry to start this thread again, but it would not have been wise to ask
my related question in a different thread.
I tried to run the program on a windows machine, apparently the regex in
question only lists directories within directories and not the files within
the directories.
I tried Rob's regex as well as Randal's.
In addition how can I modify the code, so that the buildlist.txt only
lists the files within the directories and not the directories?

TIA!


-------------------------------------------------------------------------------------------------------------------------------

use strict;
use warnings;

  my $path = $ARGV[0];

  opendir DIR, $path or die "Can't open $path: $!";

  my @new = grep /[^.]/, readdir DIR;  #tried this
  #my @new = grep { $_ ne "." and $_ ne ".." } readdir DIR; #tried this
too.
  closedir DIR;

  open FILE,">c:/buildlist.txt";
  print FILE "$_\n" foreach @new; #this only lists directories within
directories and not the files within the directories
  close FILE;

  open(FILE2,">>c:/final.txt");

  foreach my $file (@new) {
    my $record = qq("SL/$file" "%ORACLE_HOME%/server/bin/$file" "$file"
NA\n);

    print $record;
    print FILE2 $record;
  }

  close FILE2;



 On 7/11/06, Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> Randal
>
> I'm in two minds as to whether to just let this go as it had gone on for
> too
> long, but I will try just once more to explain my true stance, which you
> seem
> keen to obfuscate.
>
> (Randal L. Schwartz) wrote:
> >
> >>>>>>"Rob" == Rob Dixon <[EMAIL PROTECTED]> writes:
> >
> > Rob> Not much chance of that I'm afraid Shawn. I can do without the
> apology, I
> > Rob> just wish he'd confirm that his original critique was wrong
> instead of
> > Rob> banging on about filenames with three dots. I think leaving
> people with
> > Rob> that misinformation uncorrected is a lot more important.
> >
> > My original critique was wrong.  I mistook /^[.]/ for /[^.]/.
> > So your post was wrong, but I said it was wrong for the wrong reasons.
>
> You also claimed the rest of my post was incorrect, wouldn't work and
> hadn't
> been tested. You were wrong on all counts, and clearly didn't choose to
> test the
> code yourself.
>
> > That still doesn't solve the problems I addressed about your post
> elsewhere,
> > nor that you had to go three rounds with me in private email
> repeatedly
> > looking for some way to "save" your original post from being labeled
> wrong.
>
> The quotes are yours: I was indeed trying to save it from the
> allegations of
> your incorrect response. My original post was not wrong as you described
> it, but
> only insofar as it discarded three-dot files. In context even that can
> only be
> considered a problem with portability as the OP used a Windows system
> where such
> files cannot exist. And I didn't 'go three rounds' with you - I didn't
> consider
> it a fight and am surprised if you did.
>
> > I'm here for the group.  I want people to walk away from this list
> knowing how
> > to code *better* Perl.  Your post distracted from that.  I have
> nothing
> > against you personally, but your behaviors distract from my goal, and
> will be
> > called for what they are.
>
> Randal, there are ways to correct people without being abusive and
> creating this
> monstrous storm of debate. Had your initial response been to correct
> just the
> incorrect filename filtering I doubt you would have seen an opportunity
> to be so
> vehement, and I think it is clear that defamatory posts also serve to
> distract
> from teaching people better Perl. Please try to be civil with your
> criticism and
> make this list a better place to learn and to impart what we know.
>
> Rob
>
> --
> 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