in reply to How to concatenate a generic array of arrays and an array of hashes
Using your 3 sample files, this prints:#!/usr/bin/perl use strict; use warnings; my @value; my $col_count = 0; while (<>) { # read from @ARGV (sample.txt sample_2.txt sample_3.txt) chomp; my (undef, @data) = split /:/; my $row_count = 0; for my $info (@data) { $value[$row_count++][$col_count] = $info; } ++$col_count; } for my $v (@value) { print join(" ", @$v), "\n"; }
ChrisLine_1_1 Line_2_1 Line_3_1 Line_4_1 Line_5_1 Line_6_1 Line_7_1 Line_1_2 Line_2_2 Line_3_2 Line_4_2 Line_5_2 Line_6_2 Line_7_2 Line_1_3 Line_2_3 Line_3_3 Line_4_3 Line_6_3 Line_6_3 Line_7_3 Line_1_4 Line_2_4 Line_3_4 Line_4_4 Line_5_4 Line_6_4 Line_7_4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to concatenate a generic array of arrays and an array of hashes
by thanos1983 (Parson) on Jul 06, 2014 at 18:54 UTC | |
by Cristoforo (Curate) on Jul 06, 2014 at 23:17 UTC | |
by thanos1983 (Parson) on Jul 07, 2014 at 12:15 UTC |