[go: up one dir, main page]

Menu

[b30a98]: / extract_text.pl  Maximize  Restore  History

Download this file

27 lines (22 with data), 460 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl -w
use strict;
my $fic = $ARGV[0];
open (TEXT, "< $fic" ) or die "can not open $fic : $!\n";
while (<TEXT>) {
if ( m/[\$_]text\{(.*)\}/ ) {
my $motif = $1;
$motif =~ s/'//g;
$motif =~ s/"//g;
$motif =~ s/^\s+//g;
$motif =~ s/\s+$//g;
print "$motif\n";
}elsif ( m/\&text\((.*?),/ ) {
my $motif = $1;
$motif =~ s/'//g;
$motif =~ s/"//g;
$motif =~ s/^\s+//g;
$motif =~ s/\s+$//g;
print "$motif\n";
}
}
close (TEXT);