Convert Excel File (xls) to tab delimited text file on AIX

Hi

i have a problem in my job

i try to convert an excel file (xls extention) to text file (tab delimited), but no result with this comand

cat xxx.xls > xxx.txt 

Do you have eny idea?

PS: sorry for my english

Thanks!!

Either save the spreadsheet as a csv file using Excel, or use the command line version of Office Libre Calc to convert the xls file to csv.

/usr/lib/libreoffice/program $ ./scalc --help

thanks for your prompt response
where I have mounted unix is a production server, so I have no libreoffice instaled.
This excel is generated through a process on a Windows server where I do not have access and that is what I excel prosecute txt so we can work with our top BI

google 'batch convert excel to tab delimited'
There are lots of hits, although all seem to be developed to run under Windows.

I used Perl the last time I had to deal with Excel in a *nix environment.
You can take this script as a starting point if Perl is installed and if you're able to obtain the ParseExcel module (just replace the semicolon with a tab):

#!/usr/bin/perl -w

# convert an excel file to a .csv file

use strict;
use Spreadsheet::ParseExcel;

if ($#ARGV != 1) {
   print "\nUsage: excel2csv.pl <workbook_name> <worksheet_name>\n";
   exit;
}

my $workbook_name         = $ARGV[0];
my $worksheet_name        = $ARGV[1];

my $parser                = Spreadsheet::ParseExcel->new();
my $workbook              = $parser->parse( "$workbook_name" );
my $worksheet             = $workbook->worksheet( "$worksheet_name" );

if ( !defined $workbook ) {
   die $parser-error(), ".\n";
}

my ( $row_min, $row_max ) = $worksheet->row_range();
my ( $col_min, $col_max ) = $worksheet->col_range();
my $output                = '';
for my $row ( $row_min .. $row_max ) {
   for my $col ( $col_min .. $col_max ) {
      my $cell            = $worksheet->get_cell( $row, $col );
      if ( $cell ) {
         my $cell_value   = $cell->value();
         $cell_value      =~ s/\;/,/g;
         $output          = $output . $cell_value . ';';
      }
      else {
         $output          = $output . ';';
      }
   }
   print "$output\n";
   $output                = '';
}