in reply to Concatenating arrays fetched from different text files
I tried the code below to get those results.
Hope this might be what you were looking for.#!/usr/bin/perl use strict; use warnings; my @value; my $i = 0; while (<>) { # read from @ARGV chomp; push @{ $value[$i++] }, /:([^:]+)/; # get timestamp $i = 0 if eof; } my $write = 'write.txt'; open my $out , ">" , $write or die "Could not open: $write - $!\n"; print $out localtime . "\n"; print $out "@$_\n" for @value; close $out or die "Could not close: $write - $!\n"; print "Successfully written on $write.\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Concatenating arrays fetched from different text files
by hexcoder (Curate) on May 29, 2014 at 10:56 UTC | |
by thanos1983 (Parson) on May 29, 2014 at 19:46 UTC | |
by hexcoder (Curate) on May 29, 2014 at 20:55 UTC | |
by thanos1983 (Parson) on May 30, 2014 at 10:53 UTC | |
|
Re^2: Concatenating arrays fetched from different text files
by thanos1983 (Parson) on May 29, 2014 at 09:16 UTC | |
by Laurent_R (Canon) on May 29, 2014 at 10:54 UTC | |
by thanos1983 (Parson) on May 29, 2014 at 19:42 UTC | |
by Laurent_R (Canon) on May 29, 2014 at 20:17 UTC |