Dear All, i have created the below script working fine to extract the query text and store in a variable. After that, i need to place the values after two carriage returns. I don't know how to place the query values after two carriage return.
Kindly suggest friends!
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 $I
+nputXmlFile");
my $inText = join("",<INTXT>);
close (INTXT);
while($inText =~ m#\\section\{(.*?)\}\n\n#gi)
{
my $qrtext = $1;
if ($qrtext =~m/\\qr\{(.*?)\}/)
{
my $qrFindText = $1;
print $qrFindText;
}
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|