On 22.11.2010 11:24, Rene wrote:
> Works like a charm. Thanks, Roland!
>
But seems to me a bit cumbersome. Here a Perl script, which is printing
out the wished result to your shell in one run:
***
First File, on Desktop: example.pl
***
#!/usr/bin/perl
use strict;
use warnings;
my $file_name = "example.txt";
my $folder =
"$ENV{HOME}/Desktop";
open IN, "$folder/$file_name" or die "Error! $!\n;";
while (<IN>) {
if (/(.+?)(\d+)\.tif\n/i) {
my $tif_name = $2;
$tif_name=~tr/1234567890/ABCDEFGHIJ/;
print "$1$tif_name.tif\n";
next;
}
print;
}
***
Second File, on Desktop: example.txt
***
001 0000 V C 00:02:19:18 00:02:25:07 00:02:19:18
00:02:25:07
* FROM CLIP NAME: 1234.tif
* FROM CLIP IS A STILL
001 0000 V C 00:02:19:18 00:02:25:07 00:02:19:18
00:02:25:07
* FROM CLIP NAME: 3456.tif
* FROM CLIP IS A STILL
001 0000 V C 00:02:19:18 00:02:25:07 00:02:19:18
00:02:25:07
* FROM CLIP NAME: 7890.tif
* FROM CLIP IS A STILL
001 0000 V C 00:02:19:18 00:02:25:07 00:02:19:18
00:02:25:07
* FROM CLIP NAME: 3657.tif
* FROM CLIP IS A STILL
001 0000 V C 00:02:19:18 00:02:25:07 00:02:19:18
00:02:25:07
* FROM CLIP NAME: 5860.tif
* FROM CLIP IS A STILL
--
___________________________________________
the embassy for talented young musicians
Podium International | Marek Stepanek | [email protected]
http://www.PodiumInternational.org
___________________________________________
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem,
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>