|
|
| "be consistent" | |
| PerlMonks |
Break List into Pieces (was: other ways ?)by physi (Friar) |
| on May 15, 2002 at 12:52 UTC ( [id://166783]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.physi has asked for the wisdom of the Perl Monks concerning the following question:
Brothers, I'm currently 'perling' a classic perl task. But I'm not quite sure, if the is a much better way. Maybe some of you have another idea to do this: I got a big file with about 20 different 'lists' in it. Each list must be broken into peaces, exactly by a given template. I got the 'coordinates' of the different Tag-Regions. i.e.:
List 100:
W01 625 Z01 WWGZU Q19 0.343
S02 W222G02 XXXX9 B11 Mr.
G03 uu 1 Adams
This has to be converted into :
W01 625 Z01 WWGZU Q19 0.343 S02 W222 G02 XXXX9 B11 Mr.|Adams G03 uu 1So my idea was to take one whole list, put it into an $hash->{col}->{row} hash, and took out all the defined tags by there coordinates. This works, but it's a bit slow. The hash-filling took a lot of time, I guess: But maybe there is a much better way for this kind of task, or even a cpan-module? Thanks for any suggestions.
updated by boo_radleyTitle change
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||