If we want to convert comma- or space-seperated text files to Excel ones, we have to open Excel and do manual conversion. Is there automatic way to do batch conversion? Of course, you can do batch conversion without opening Excel with Data::Table::Excel.
Data::Table::Excel is a Perl module to convert between Data::Table objects and Excel (xls/xlsx) files. Data::Table reads CSV, SQL database and Excel files and converts them to CSV, HTML table and Excel files. That means we can convert between CSV files and Excel files.
Here it is a sample to use Data::Table::Excel. In the script, all TXT tables are converted to seperated sheets in one Excel files. You may modify the script to convert each TXT file to one Excel file.
Save the script to convert.pl or other name. To use the script, do this: