#!/usr/bin/perl -w

use strict 'refs';
use strict 'vars';

use utf8;
use Excel::Writer::XLSX;

my $excelout = 'bugreport.xlsx';
my $workbook = Excel::Writer::XLSX->new($excelout);

my $lookupfrm=qq{=IFERROR(VLOOKUP(A%d,\$Lookup.\$%s\$1:\$%s\$10000,%d,FALSE),"")};

my $worksheet;
my @u=("root","*",0,0,"no gecos","/root","/bin/sh");
my $row=0;

print STDERR "# write Excel unix users\n";
$worksheet=$workbook->add_worksheet('unix users');
$worksheet->keep_leading_zeros();

$u[4]=sprintf($lookupfrm,1+$row,"A","B",2),
$worksheet->write($row, 0, \@u);
print STDERR "# unix user @u\n";

$worksheet=$workbook->add_worksheet('Lookup');
my @l=("root","root user");

$worksheet->write($row, 0, \@l);
print STDERR "# lookup @l\n";

$workbook->close();

