NAME

    Text::FixedWidth::Parser 

DESCRIPTION

    The Text::FixedWidth::Parser module allows you to read fixed width text file by specifying string mapper

SYNOPSIS

 use Text::FixedWidth::Parser;

 FileData
 ~~~~~~~~
 ADDRESS001XXXXX YYYYYYY84 SOUTH STREET USA
 MARK00182869890         
 ADDRESS002YYYYYYY      69 BELL STREET  UK 
 MARK00288698939         

 my $string_mapper = [
       {
           Rule => {
               LinePrefix => [1, 7],
               Expression => "LinePrefix eq 'ADDRESS'"
           },
           Id   => [8,  3],
           Name => [11, 13],
           Address => {DoorNo => [24, 2], Street => [26, 14]},
           Country => [40, 3]
       },
       {
           Rule => {
               LinePrefix => [1, 4],
               Expression => "LinePrefix eq 'MARK'"
           },
           Id    => [5,  3],
           Mark1 => [8,  2],
           Mark2 => [10, 2],
           Mark3 => [12, 2],
           Mark4 => [14, 3],
       }
 ];


 # StringMapper should be passed while creating object
 my $obj = Text::FixedWidth::Parser->new( 
               { 
                  #Required Params
                  StringMapper  => $string_mapper,
                  #optional Params
                  ConcateString => '', 
                  EmptyAsUndef  => 1
               }
           );

 open my $fh, '<', 'filename';

 $data = $obj->read($fh);

PARAMS

METHODS

LICENSE

This library is free software; you can redistribute and/or modify it under the same terms as Perl itself.

AUTHORS

Venkatesan Narayanan, venkatesanmusiri@gmail.com