J
Jack S
Hi, i'm playing with perl for my first time and want to use it to extract
some words from a string.
How the string looks:
PrimeraDiv 05.09.1993 Ath._Bilbao Albacete 4-1 ( - )
Or:
PrimeraDiv 23.05.2004 Zaragoza Barcelona 2-1 ( 1-1 )
Now, i want to extract the second word, in this case a date.
The third and forth words(team names). The result and the half-time result
(between parentesis). Sometimes half-time result isn't available and i want
to replace it with the string "NA".
I know how to get the data from the file(wich is where the strings are
located):
open(LOG, "c:\\SPA_1993-1994.txt");
@indata = <LOG>;
But how can i use reg. expressions to match the words i told you? and most
important how can i extract them?
Thanks
some words from a string.
How the string looks:
PrimeraDiv 05.09.1993 Ath._Bilbao Albacete 4-1 ( - )
Or:
PrimeraDiv 23.05.2004 Zaragoza Barcelona 2-1 ( 1-1 )
Now, i want to extract the second word, in this case a date.
The third and forth words(team names). The result and the half-time result
(between parentesis). Sometimes half-time result isn't available and i want
to replace it with the string "NA".
I know how to get the data from the file(wich is where the strings are
located):
open(LOG, "c:\\SPA_1993-1994.txt");
@indata = <LOG>;
But how can i use reg. expressions to match the words i told you? and most
important how can i extract them?
Thanks