Thread array aus mehreren array erstellen und in skalar umwandeln (18 answers)
Opened by derPerlwwerker at 2019-09-13 20:47

Muffi
 2019-09-16 08:56
#190479 #190479
User since
2012-07-18
1465 Artikel
BenutzerIn
[default_avatar]
Sowas in der Art?

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
my @lines = ('Attribut1 50 :xyz,xy', 'Attribut2 Zeit :nv', 'Attribut3 17:00:00 :nv,oder');

my @data = ();

my $CMD = "attr";
my $DEV = "Rollladensteuerung";

for my $line_str (@lines) {
        my @cols = split(/ /, $line_str);
        
        push @data, { Attr => $cols[0], Value => $cols[1], Selection => $cols[2] };
}


for my $data_line (@data) {
        say "$CMD $DEV $data_line->{Attr} $data_line->{Value}";
}
1 + 1 = 10

View full thread array aus mehreren array erstellen und in skalar umwandeln