Leser: 1
3 Einträge, 1 Seite |
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
27
28
29
30
31
32
33
34
35
36
37
38
#! /usr/bin/perl
use strict;
use warnings;
use diagnostics;
use Tk;
my $mw = MainWindow->new();
my $liste = $mw->ScrlListbox(-label => "Liste",
-selectmode => "extended",
-height => 6,
-exportselection => 0)->pack();
my $startButton = $mw -> Button(-text => "start", -command => \&write_file)->pack();
&fill_list();
MainLoop;
sub fill_list{
my $file = '/Pfad/zur/Datei.txt';
open(DATEI,"<$file") or die $!;
while(my $line = <DATEI>){
chomp $line;
$liste->insert("end",$line);
}
close DATEI;
}
sub write_file{
my $file = '/Pfad/zur/Zieldatei.txt';
my @sel_items = $liste->Getselected();
open(WRITE,">$file") or die $!;
for(@sel_items){
print WRITE $_,"\n";
}
close WRITE;
}
3 Einträge, 1 Seite |