X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=txt2xls;h=c79fb53b2d1c2ff63594602f14c280b34ac97cbc;hb=56c8d8b286ae38e170ce915472f9aa86fabf9fee;hp=6ac3a94e3b1978476f706dfd31d0add84d76ec39;hpb=fd3b47e616df71293bb6d3219697b15f2c86ca79;p=bin.git diff --git a/txt2xls b/txt2xls index 6ac3a94..c79fb53 100755 --- a/txt2xls +++ b/txt2xls @@ -101,7 +101,8 @@ GetOptions(\%options, 'sci_format|sci-format=s', 'max_digits|max-digits=i', 'rmode|r-mode|r!', - 'remove_name|remove-name=s@', + 'remove_name|remove-name=s@', + 'output|output_file|output-file=s', 'debug|d+','help|h|?','man|m'); pod2usage() if $options{help}; @@ -139,7 +140,13 @@ if (not @{$options{remove_name}}) { my %wb_formats = (); my $csv = Text::CSV->new({sep_char=>$sep_char}); -my $wb = Spreadsheet::WriteExcel->new(\*STDOUT); +my $wb; +if (defined $options{output}) { + $wb = Spreadsheet::WriteExcel->new($options{output}); +} else { + $wb = Spreadsheet::WriteExcel->new(\*STDOUT); +} + for my $file (@ARGV) { my $fh; if (not defined $file) {