use strict; use warnings; my $InputXmlFile = $ARGV[0]; my $OutputXmlFile = $InputXmlFile; my $OutProcesText = ""; $OutputXmlFile =~ s#\.tex$#\.tex#gsi; my $workingpath = $1 if $InputXmlFile =~ m/(.*)\\(.+)\.tex/i; my $filename = $2 if $InputXmlFile =~ m/(.*)\\(.+)\.tex/i; open (INTXT, "$InputXmlFile") ||die ("Can't open the input file $InputXmlFile"); my $inText = join("",); close (INTXT); while($inText =~ m#\\section\{(.*?)\}\n\n#gi) { my $qrtext = $1; if ($qrtext =~m/\\qr\{(.*?)\}/) { my $qrFindText = $1; print $qrFindText; } }