in reply to Complex Mapping
If first line always mention the 'titles' and second line mentions the values in the same order as 'titles', then you work is easy. Assuming you have no spaces in your individual data-value, here is the code that can help
Thus you have build the hash of Keys and values which you can use in your script directly or use reference file to write these key-values and read from it.chomp($title_line = <DATAFILE>); chomp($value_line = <DATAFILE>); @titles = split /\s+/,$title_line; @values = split /\s+/,$value_line; map { $Data->{$_} = shift @values } @titles;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Complex Mapping
by LanceDeeply (Chaplain) on Jun 27, 2003 at 22:16 UTC |