...

View Full Version : perl script to convert multi-line data records in txt file to Excel XLS



Magikron
03-26-2010, 09:36 PM
I have a text file report that I need to translate to XLS. There are 2 lines of data for each record that I need to concatenate into one line and then extract the data to map to an XLS excel spreadsheet. See sample below. I want to automate this process as each text file contains 124 pages of data that I need to remap to Excel.

Token Report Date: 02/12/2010 08:20:19
All Tokens Page: 1 of 124


Serial No. User Name Token Status Last Login
-->Token Type/Auth with/Algorithm Start Date Shutdown Date

000030470765 Bill Ding Enabled,NewPIN 01/01/1986 00:00:00
-->Key Fob/Passcode/AES 03/16/2006 00:00:00 08/31/2010 00:00
000030470766 Joe South Enabled 01/21/2010 19:25:17
-->Key Fob/Passcode/AES 03/16/2006 00:00:00 08/31/2010 00:00

Thanks in advance.

MetalGear
03-29-2010, 08:47 AM
you can use Spreadsheet::ParseExcel ,Spreadsheet::WriteExcel
and other related packages, to create and write to an excel file.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum