in reply to Re^2: extract and export to multiple files
in thread extract and export to multiple files
I strongly recommend that you follow the links (did I make them too subtle?) and read the documentation. In fact spending a few hours browsing the documentation that came with Perl and a few more hours reading some of the Perl tutorial and reference books ("Learning Perl" and "Programming Perl" at least) will save you days of beating your head against the desk if you intend to use Perl regularly. There are some good recommendations in the So what is your Perl book "Trilogy" anyway? thread. Visiting the Tutorials section is well worth doing too.
I followed the pattern you gave (">$filename"."$title"."$count") for forming the file name. The sequence number following the file name is what you would have got in your original code. If you want to put it before the last '.' then you need to edit the file name string. Something like the following in place of the original $outpath assignment ought do the trick:
my $outpath = "$outdir/$title"; $outpath =~ s/(\.[^.]*|)$/$.$1/;
You will definitely want to read some of the documentation for regular expressions: perlrequick and perlretut at least (there is more).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: extract and export to multiple files
by zzgulu (Novice) on Apr 10, 2010 at 02:18 UTC | |
by GrandFather (Saint) on Apr 10, 2010 at 05:09 UTC | |
by zzgulu (Novice) on Apr 10, 2010 at 15:47 UTC |