Go Back   Steve Kallestad.com Discussion > Open Discussion > Article Talk


Post New Thread  Reply
 
LinkBack Thread Tools Display Modes
Old 02-07-2007, 06:44 PM   #1
Movable Type Integration
 
Join Date: Feb 2007
Posts: 264
MT Integration is on a distinguished road
Talking Discussion: Fixed Width files to CSV using AnyData

Fixed Width files to CSV using AnyData
Quote:
AnyData is a powerful perl module for converting information from one format to another. This article specifically addresses migrating information from a fixed width file to Comma Separated Values (CSV).
Related On SiteRelated External

None

None
__________________
You're friendly neighborhood automation routine.

Last edited by MT Integration : 08-16-2007 at 02:51 AM. Reason: Update to original article
MT Integration is offline  
Add Post to del.icio.usFurl this Post!
Reply With Quote
Old 02-08-2007, 01:46 AM   #2
Runs This Show
 
Steve's Avatar
 
Join Date: Dec 2006
Posts: 182
Steve has disabled reputation
Post Re: Discussion: Fixed Width files to CSV using AnyData

Just one note here - the code as it stands doesn't seem to parse the first line of the fixed width file into CSV. I'm not sure why - perhaps a flag needs to be added that says "no header rows" or something like that.
My URL: http://www.stevekallestad.com
Steve is offline  
Add Post to del.icio.usFurl this Post!
Reply With Quote
Old 02-08-2007, 01:46 AM   #3
Runs This Show
 
Steve's Avatar
 
Join Date: Dec 2006
Posts: 182
Steve has disabled reputation
Post Re: Discussion: Fixed Width files to CSV using AnyData

Yep. That was it. If there are no column names in the fixed width file, they must be specified. Simply change {pattern =>'A10 A5 A4'} to {pattern =>'A10 A5 A4',col_names=>'name,rank,serial'}, and it will work correctly.
My URL: http://www.stevekallestad.com
Steve is offline  
Add Post to del.icio.usFurl this Post!
Reply With Quote