All pastes #398391 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-17 04:34 UTC
rendered paste body
#!/usr/bin/perl -w

use strict;

my @fld_names;
my @records;

#
# open your file here
#
#

my $line = 0;
while( <PART> ){
  $line++;
  next if( $line == 1 );
  next if( $line == 2 );
  if( $line == 3 ){
    @fld_names = split /\;/, $_;
  }
  else{
    my @flds = split /\;/, $_;

    my %rec;

    for( my $i = 0; $i < @flds_names; $i++ ){
      $rec{$fld_names[$i]} = $flds[$i];
    }
    push @records, \%rec;
  }
}
~