in reply to a little REGEX help

If your data is fixed width like your example and purely ASCII text you could also use unpack.

while (<DATA>) { chomp; my ( $currencies, $amount, $time ) = unpack '@0 A8 @9 A10 @20 A9', + $_; next unless ( $currencies eq 'EUR/USD' ); print <<"END_OUTPUT"; Amount: $amount Time: $time END_OUTPUT } __DATA__ EUR/USD ,1.35590 ,13:09:31 EUR/JPY , 129.872 ,13:09:29 GBP/JPY , 138.009 ,13:09:32 AUD/JPY , 65.939 ,13:09:30 EUR/USD ,1.35592 ,13:09:35 EUR/JPY , 129.866 ,13:09:35 GBP/JPY , 137.999 ,13:09:35 AUD/JPY , 65.938 ,13:09:35 EUR/USD ,1.35592 ,13:09:35

I read this tip in the perl best practices book.

Replies are listed 'Best First'.
Re^2: a little REGEX help
by Zen (Deacon) on Mar 23, 2009 at 15:23 UTC
    Consider using a database for time series data.