yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | use strict; |
2 | |||||
3 | my $backup = $/; | ||||
4 | undef $/; | ||||
5 | my $input = <>; | ||||
6 | $/ = $backup; | ||||
7 | |||||
8 | my @text = split(/[\n\r]+/, $input); | ||||
9 | my $flag_7z = 0; | ||||
10 | foreach my $line (@text) | ||||
11 | { | ||||
12 | next if ($line eq ""); | ||||
13 | if (($line =~ /^\s*7-Zip/i) || ($line =~ /^\s*Listing archive/i)) | ||||
14 | { | ||||
15 | $flag_7z = 1; | ||||
16 | next; | ||||
17 | } | ||||
18 | if ($flag_7z) | ||||
19 | { | ||||
20 | if ($line =~ /^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\d+)\s+(.+)\s*$/) | ||||
21 | { | ||||
22 | $line = $6; | ||||
23 | } | ||||
24 | else | ||||
25 | { | ||||
26 | next; | ||||
27 | } | ||||
28 | } | ||||
29 | $line =~ s/\\/\//g; | ||||
30 | next if ($line =~ /\/$/); | ||||
31 | next if (-d $line); | ||||
32 | $line =~ s/ /\\?/g; | ||||
33 | $line =~ s/\#/\\\\\\#/g; | ||||
34 | print $line . "\n"; | ||||
35 | } |