in reply to Fast reading and processing from a text file - Perl vs. FORTRAN

Well, "extract info" (in your pseudocode) is pretty vague. There are a lot of ways to grab fixed-width data from a file. The ones that come to mind ... I'd recommend switching the parsing to unpack, you will probably see a big speedup (especially if you're currently grabbing the data with regexes). Use the "A<num>" pack template to get a <num>-character field from the data.

Actually, you should benchmark split vs. unpack against your data but I'm almost positive unpack will be faster.

blokhead

  • Comment on Re: Fast reading and processing from a text file - Perl vs. FORTRAN