in reply to Augmented pipe delimited output
Something like:
#!/usr/bin/perl use strict; use warnings; my @data = map {[("") x 8]} 1 .. 5; $data[$_][0] = "host" . ($_ + 1) for 0 .. 4; $data[$_][3] = 'C' for 0, 1, 3; for my $row (@data) { @{$row}[4, 6] = ('N', 'G') if !length($row->[3]); print join('|', @$row), "\n"; }
Prints:
host1|||C|||| host2|||C|||| host3||||N||G| host4|||C|||| host5||||N||G|
|
|---|